|
Last change
on this file since baaf6c8 was e607c0f, checked in by dportnoy <dmp1488@…>, 13 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
|
| Line | |
|---|
| 1 | #ifndef _COMMON_H
|
|---|
| 2 | #define _COMMON_H
|
|---|
| 3 |
|
|---|
| 4 | void set_nonblock(int sock)
|
|---|
| 5 | {
|
|---|
| 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 | }
|
|---|
| 16 |
|
|---|
| 17 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.