Raised This Month: $ Target: $400
 0% 

TF2 logs throws


Post New Thread Reply   
 
Thread Tools Display Modes
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 09-26-2013 , 23:30   Re: TF2 logs throws
Reply With Quote #11

Hey guys, all a big thanks, I finally make it work. Here is the ugly horrible basic 1 time log code lol. I will work on it tommorrow, but at least it work -.-.

PHP Code:
#pragma once
#pragma comment(lib, "Ws2_32.lib")

#include <WinSock2.h>
#include <Windows.h>
#include <iostream>

using namespace std;

int main()
{
        
WSAData wsaData;
        
WORD DllVersion MAKEWORD(2,2);

        
int startup_RetVal WSAStartup(DllVersion, &wsaData);

        
SOCKET sSocket socket(AF_INETSOCK_DGRAMIPPROTO_UDP);

        
SOCKADDR_IN addr;

        
addr.sin_addr.s_addr INADDR_ANY;
        
addr.sin_family AF_INET;
        
addr.sin_port htons(2222);

        
int iResult bind(sSocket, (SOCKADDR*)&addrsizeof(addr));
        if (
iResult == SOCKET_ERROR) {
            
wprintf(L"bind failed with error %u\n"WSAGetLastError());
            
closesocket(sSocket);
            
WSACleanup();
        }
        else
        {
            
cout << "binded :)" << endl;



            
char buf[1024] = {0};

            
recvfrom(sSocketbuf64NULLNULLNULL);

            
cout << buf << endl;
        }
        
getchar();

        return 
0;

Great thanks again.
Mathias. is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode