source: network-game/common/Common.h@ e607c0f

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

The client uses nonblocking calls to check for server messages and textboxes can now process all the standard keyboard keys

  • Property mode set to 100644
File size: 313 bytes
RevLine 
[3b1efcc]1#ifndef _COMMON_H
2#define _COMMON_H
3
4void set_nonblock(int sock)
5{
[e607c0f]6 #ifdef WIN32
7 unsigned long mode = 1;
8 ioctlsocket(sock, FIONBIO, &mode);
9 #else
10 int flags;
11 flags = fcntl(sock, F_GETFL,0);
12 assert(flags != -1);
13 fcntl(sock, F_SETFL, flags | O_NONBLOCK);
14 #endif
[3b1efcc]15}
16
17#endif
Note: See TracBrowser for help on using the repository browser.