source: network-game/common/Common.cpp@ 88cdae2

Last change on this file since 88cdae2 was 4c202e0, checked in by dportnoy <dmp1488@…>, 12 years ago

Added Player to the visual studio project, changed Common to use the #defines in Compiler.h, and added basic client support for processing MSG_TYPE_PLAYER messages

  • Property mode set to 100644
File size: 310 bytes
RevLine 
[edfd1d0]1#include "Common.h"
2
3void set_nonblock(int sock)
4{
[4c202e0]5 #if defined WINDOWS
[edfd1d0]6 unsigned long mode = 1;
7 ioctlsocket(sock, FIONBIO, &mode);
[4c202e0]8 #elif defined LINUX
[edfd1d0]9 int flags;
10 flags = fcntl(sock, F_GETFL,0);
11 assert(flags != -1);
12 fcntl(sock, F_SETFL, flags | O_NONBLOCK);
13 #endif
14}
Note: See TracBrowser for help on using the repository browser.