summaryrefslogtreecommitdiffstats
path: root/examples/example.c
diff options
context:
space:
mode:
authordscho <dscho>2005-05-07 13:33:09 +0000
committerdscho <dscho>2005-05-07 13:33:09 +0000
commit34f714bcdc3e2d7a21a9179357dc93f2561301c8 (patch)
tree850d98f9535bd0e1fa10faff773e5069bbefbd40 /examples/example.c
parent1bb36df34ea25a3379b5232154a55e4da489ab60 (diff)
downloadlibvncserver-34f714bcdc3e2d7a21a9179357dc93f2561301c8.zip
libvncserver-34f714bcdc3e2d7a21a9179357dc93f2561301c8.tar.gz
socketInitDone -> socketState
Diffstat (limited to 'examples/example.c')
-rw-r--r--examples/example.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/example.c b/examples/example.c
index da1385e..f4a1f08 100644
--- a/examples/example.c
+++ b/examples/example.c
@@ -168,6 +168,12 @@ void dokey(rfbBool down,rfbKeySym key,rfbClientPtr cl)
if(down) {
if(key==XK_Escape)
rfbCloseClient(cl);
+ else if(key==XK_F12)
+ /* close down server, disconnecting clients */
+ rfbShutdownServer(cl->screen,TRUE);
+ else if(key==XK_F11)
+ /* close down server, but wait for all clients to disconnect */
+ rfbShutdownServer(cl->screen,FALSE);
else if(key==XK_Page_Up) {
initBuffer((unsigned char*)cl->screen->frameBuffer);
rfbMarkRectAsModified(cl->screen,0,0,maxx,maxy);
@@ -294,7 +300,7 @@ int main(int argc,char** argv)
#ifdef USE_OWN_LOOP
{
int i;
- for(i=0;;i++) {
+ for(i=0;rfbIsActive(rfbScreen);i++) {
fprintf(stderr,"%d\r",i);
rfbProcessEvents(rfbScreen,100000);
}
@@ -315,7 +321,6 @@ int main(int argc,char** argv)
while(1) sleep(5); /* render(); */
#endif /* BACKGROUND_LOOP */
- rfbFreeCursor(rfbScreen->cursor);
free(rfbScreen->frameBuffer);
rfbScreenCleanup(rfbScreen);
OpenPOWER on IntegriCloud