summaryrefslogtreecommitdiffstats
path: root/libvncserver/rfbserver.c
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2010-09-07 17:43:58 +0200
committerChristian Beier <dontmind@freeshell.org>2010-09-13 14:19:15 +0200
commitc0373e9cd48b0fc22ac295fdab51a29e3df7a0cd (patch)
tree253b193dfb1805cd6de337f26cf6f82e74a42cad /libvncserver/rfbserver.c
parent0df84e5c27eefad8b731b12d58f8fbede71823e0 (diff)
downloadlibtdevnc-c0373e9cd48b0fc22ac295fdab51a29e3df7a0cd.tar.gz
libtdevnc-c0373e9cd48b0fc22ac295fdab51a29e3df7a0cd.zip
Non-blocking sockets for Windows.
Expands the SetNonBlocking() function in libvncclient/sockets.c to also work under Windows and also changes it to honour maybe already present socket flags. A similar function was introduced for libvncserver as well and all the #ifdef'ed fnctl calls replaced with calls to that one. Signed-off-by: Christian Beier <dontmind@freeshell.org>
Diffstat (limited to 'libvncserver/rfbserver.c')
-rw-r--r--libvncserver/rfbserver.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index 471dac3..5f8d22a 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -299,13 +299,10 @@ rfbNewTCPOrUDPClient(rfbScreenInfoPtr rfbScreen,
}
rfbReleaseClientIterator(iterator);
-#ifndef WIN32
- if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) {
- rfbLogPerror("fcntl failed");
+ if(!rfbSetNonBlocking(sock)) {
close(sock);
return NULL;
}
-#endif
if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
(char *)&one, sizeof(one)) < 0) {