mudgangster

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

unix_network.cc (526B)


      1 #include <arpa/inet.h>
      2 #include <netinet/tcp.h>
      3 #include <sys/types.h>
      4 #include <sys/select.h>
      5 #include <sys/socket.h>
      6 #include <errno.h>
      7 #include <netdb.h>
      8 #include <unistd.h>
      9 
     10 #define INVALID_SOCKET ( -1 )
     11 #define SOCKET_ERROR ( -1 )
     12 
     13 #define closesocket close
     14 
     15 #if PLATFORM_OSX
     16 static int NET_SEND_FLAGS = 0;
     17 #else
     18 static int NET_SEND_FLAGS = MSG_NOSIGNAL;
     19 #endif
     20 
     21 void net_init() { }
     22 void net_term() { }
     23 
     24 static void platform_init_sock( int fd ) {
     25 #if PLATFORM_OSX
     26 	setsockoptone( fd, SOL_SOCKET, SO_NOSIGPIPE );
     27 #endif
     28 }