diff options
author | dscho <dscho> | 2005-05-07 13:33:09 +0000 |
---|---|---|
committer | dscho <dscho> | 2005-05-07 13:33:09 +0000 |
commit | 34f714bcdc3e2d7a21a9179357dc93f2561301c8 (patch) | |
tree | 850d98f9535bd0e1fa10faff773e5069bbefbd40 /examples | |
parent | 1bb36df34ea25a3379b5232154a55e4da489ab60 (diff) | |
download | libtdevnc-34f714bcdc3e2d7a21a9179357dc93f2561301c8.tar.gz libtdevnc-34f714bcdc3e2d7a21a9179357dc93f2561301c8.zip |
socketInitDone -> socketState
Diffstat (limited to 'examples')
-rw-r--r-- | examples/example.c | 9 | ||||
-rw-r--r-- | examples/fontsel.c | 4 |
2 files changed, 10 insertions, 3 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); diff --git a/examples/fontsel.c b/examples/fontsel.c index 4aa702c..a2a2f82 100644 --- a/examples/fontsel.c +++ b/examples/fontsel.c @@ -58,13 +58,15 @@ int main(int argc,char** argv) exit(1); } - for(j=0;j<0;j++) + for(j=0;j<0 && rfbIsActive(s);j++) rfbProcessEvents(s,900000); i = rfbSelectBox(s,font,fontlist,10,20,200,300,0xffdfdf,0x602040,2,showFont); rfbLog("Selection: %d: %s\n",i,(i>=0)?fontlist[i]:"cancelled"); rfbFreeFont(font); + free(s->frameBuffer); + rfbScreenCleanup(s); return(0); } |