WIN32

by Gavino on July 21st, 2010
No notes
Syntax: C++
Show lines - Hide lines - Show in textbox - Download
#ifdef WIN32
#include <winsock2.h>
#include <winsock.h>
#include <ws2tcpip.h>
#else
#include <ifaddrs.h>
#include <netdb.h>
#endif
1 Comment
  1. WIN32 bis permalink

    #ifdef WIN32
    ULONG dummy = inet_addr(ip.c_str());
    socketAddr_in.sin_addr.s_addr = dummy;
    #else
    if(inet_aton(ip.c_str(), &socketAddr_in.sin_addr)==0) {
    fprintf(stderr, “inet_aton() failed\n”);
    exit(1);
    }
    #endif

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS