mudgangster

Tiny, scriptable MUD client
Log | Files | Refs | README

win32_network.cc (368B)


      1 #include <winsock2.h>
      2 #include <ws2tcpip.h>
      3 
      4 #define ssize_t int
      5 
      6 static int NET_SEND_FLAGS = 0;
      7 
      8 void net_init() {
      9 	WSADATA wsa_data;
     10 	if( WSAStartup( MAKEWORD( 2, 2 ), &wsa_data ) == SOCKET_ERROR ) {
     11 		FATAL( "WSAStartup" );
     12 	}
     13 }
     14 
     15 void net_term() {
     16 	if( WSACleanup() == SOCKET_ERROR ) {
     17 		FATAL( "WSACleanup" );
     18 	}
     19 }
     20 
     21 static void platform_init_sock( SOCKET fd ) { }