From 38b98c9ecd0c300d40ae6db05ab9dc2b9189df8d Mon Sep 17 00:00:00 2001 From: oroborus Date: Tue, 1 Jul 2008 17:53:41 +0000 Subject: - 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 --- src/net_unix/udp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/net_unix/udp.c') 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 #include #include +#include #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; -- cgit v1.2.3