Changeset edfd1d0 in network-game for common/Common.h
- Timestamp:
- Dec 25, 2012, 6:27:14 PM (12 years ago)
- Branches:
- master
- Children:
- 4c202e0
- Parents:
- baaf6c8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Common.h
rbaaf6c8 redfd1d0 2 2 #define _COMMON_H 3 3 4 void set_nonblock(int sock) 4 #include <fcntl.h> 5 #include <assert.h> 6 7 void set_nonblock(int sock); 8 9 typedef struct 5 10 { 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 15 } 11 int x; 12 int y; 13 } PLAYER_POS; 16 14 17 15 #endif
Note:
See TracChangeset
for help on using the changeset viewer.