summaryrefslogtreecommitdiffstats
path: root/libvncclient/sockets.c
diff options
context:
space:
mode:
authordscho <dscho>2004-06-07 08:31:57 +0000
committerdscho <dscho>2004-06-07 08:31:57 +0000
commit2b8c2a5c3a71364e402b4df334a6f5aff5ed77a9 (patch)
tree66e59b58f919f5848780d5c7d6c954160e289cff /libvncclient/sockets.c
parent98e4f89569587c143a56e4dcf8162a035efc361e (diff)
downloadlibtdevnc-2b8c2a5c3a71364e402b4df334a6f5aff5ed77a9.tar.gz
libtdevnc-2b8c2a5c3a71364e402b4df334a6f5aff5ed77a9.zip
add client_examples/, add SDLvncviewer, libvncclient API changes, suppress automake CFLAGS nagging
Diffstat (limited to 'libvncclient/sockets.c')
-rw-r--r--libvncclient/sockets.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libvncclient/sockets.c b/libvncclient/sockets.c
index 77dec7c..6954ed3 100644
--- a/libvncclient/sockets.c
+++ b/libvncclient/sockets.c
@@ -422,3 +422,24 @@ PrintInHex(char *buf, int len)
fflush(stderr);
}
+
+int WaitForMessage(rfbClient* client,unsigned int usecs)
+{
+ fd_set fds;
+ struct timeval timeout;
+ int num;
+
+ timeout.tv_sec=(usecs/1000000);
+ timeout.tv_usec=(usecs%1000000);
+
+ FD_ZERO(&fds);
+ FD_SET(client->sock,&fds);
+
+ num=select(client->sock+1, &fds, NULL, NULL, &timeout);
+ if(num<0)
+ rfbClientLog("Waiting for message failed: %d (%s)\n",errno,strerror(errno));
+
+ return num;
+}
+
+