diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-07-01 17:53:41 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-07-01 17:53:41 +0000 |
| commit | 38b98c9ecd0c300d40ae6db05ab9dc2b9189df8d (patch) | |
| tree | 2c13c890e75f95c778f4ed8c9933a3852cac2907 /src/net_unix/udp.c | |
| parent | 62cdf2b04aa8d0162da8e024d9901ba5743bf5e3 (diff) | |
- oprava chyby pri teleportacii lasserov
- skutocne opravena chybya s neinicializovany audiom, a strielanim pri chodeni
- ZeXxove patche pre spojenie s master serverom
- client zobrazuje hlasku ak sa nepodarilo spojit zo serverom alebo sppojenie nasilne ukoncilo
git-svn-id: http://opensvn.csie.org/tuxanci_ng@81 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/net_unix/udp.c')
| -rw-r--r-- | src/net_unix/udp.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/net_unix/udp.c b/src/net_unix/udp.c index a701d48..79df4b0 100644 --- a/src/net_unix/udp.c +++ b/src/net_unix/udp.c @@ -12,6 +12,7 @@ #include <netdb.h> #include <string.h> #include <assert.h> +#include <fcntl.h> #define BUFSIZE 1000 @@ -149,6 +150,20 @@ sock_udp_t* connectUdpSocket(char *address, int port, int proto) return new; } +int setUdpSockNonBlock(sock_udp_t *p) +{ + int oldFlag; + + oldFlag = fcntl (p->sock, F_GETFL, 0); + + if( fcntl(p->sock, F_SETFL, oldFlag|O_NONBLOCK ) == -1 ) + { + return -1; + } + + return 0; +} + int readUdpSocket(sock_udp_t *src, sock_udp_t *dst, void *address, int len) { int addrlen; |