|
Last change
on this file since edfd1d0 was edfd1d0, checked in by dportnoy <dmp1488@…>, 13 years ago |
|
Moved the Player class to the common directory, added a position to Player, added a new message type for sending player info, and made the server broadcast player positions everytime it receives and replies to a message
|
-
Property mode
set to
100644
|
|
File size:
289 bytes
|
| Rev | Line | |
|---|
| [edfd1d0] | 1 | #include "Common.h"
|
|---|
| 2 |
|
|---|
| 3 | void set_nonblock(int sock)
|
|---|
| 4 | {
|
|---|
| 5 | #ifdef WIN32
|
|---|
| 6 | unsigned long mode = 1;
|
|---|
| 7 | ioctlsocket(sock, FIONBIO, &mode);
|
|---|
| 8 | #else
|
|---|
| 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.