From 0a4f1bada4f6e62e1cb4ffd6c34e6c8313c39aef Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Mon, 26 Oct 2009 22:24:21 +0100 Subject: libvncclient: add a non-forking listen function. Forking the whole process from deep within a library call does not really work at all with apps that use multiple threads, i.e. every reasonably modern GUI app. So, provide a non-forking listen function so that the caller can decide if to fork, start a thread, etc. This implementation adds a timeout parameter to be able to call the listen function multiple times so that it's possible to do sth. else in between, e.g. abort listening. Signed-off-by: Christian Beier Signed-off-by: Johannes Schindelin --- rfb/rfbclient.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rfb/rfbclient.h') diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h index 40c1775..aa9d2e4 100644 --- a/rfb/rfbclient.h +++ b/rfb/rfbclient.h @@ -151,6 +151,9 @@ typedef struct _rfbClient { rfbPixelFormat format; rfbServerInitMsg si; + /* listen.c */ + int listenSock; + /* sockets.c */ #define RFB_BUF_SIZE 8192 char buf[RFB_BUF_SIZE]; @@ -260,6 +263,7 @@ extern rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width /* listen.c */ extern void listenForIncomingConnections(rfbClient* viewer); +extern rfbBool listenForIncomingConnectionsNoFork(rfbClient* viewer, int usec_timeout); /* rfbproto.c */ -- cgit v1.2.1