Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Early UVNC connection timeout on idle connection

Post Reply
ppatenaude
Posts: 3
Joined: 2017-07-13 12:27

Early UVNC connection timeout on idle connection

Post by ppatenaude »

Hello,

We are planning on upgrading our UVNC server and client to version 1.2.1.1 from version 1.1.9.0. One of our requirements is that the connection will close after an hour.

When testing this with client version 1.2.1.1 and server 1.2.1.1, I see the connection closing after about 5 minutes. It seems that this only happens when there is no activity on the connection. I have tested this with the server running in Windows 7 and Windows XP.

When testing this with client version 1.2.1.1 and server 1.1.9.0, the connection stays open for the full hour.

As I understand it, the KeepAliveInterval property should keep the connection alive by sending packets every 5 seconds. We didn't make any changes to ultravnc.ini file between 1.1.9.0 and 1.2.1.1.

We are using a setup with a Linux repeater.

I enabled logging for the server, and it seems to close the same way every time I tested it. It prints out:

Code: Select all

vsocket.cpp : zero bytes read1
vncservice.cpp : SelectHDESK to Default (28) from 28
vncclient.cpp : client disconnected : 52.6.118.201 (1)
Windows XP log sample:

Code: Select all

vncmenu.cpp : ############### Usernames change: old="VetStation", new="VetStation"
 --Overlapped I/O operation is in progress.
Wed Jul 12 14:23:15 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 275 1587872758
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 39 627 236 253  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 234 515  
Wed Jul 12 14:23:16 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 275 1587872758
Wed Jul 12 14:23:17 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 275 1587872758
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 39 627 236 253  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 515 535  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 37 629 234 515  
Wed Jul 12 14:23:18 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 275 1587872758
Wed Jul 12 14:23:19 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 275 1587872758
HideDesktop.cpp : Killwallpaper 1
 --Not enough storage is available to complete this operation.
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 59 658 574 596  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 662 678 574 598  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 2 54 574 596  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 2 54 574 596  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 59 682 574 598  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 682 798 574 598  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 684 738 577 595  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 -2 802 570 602  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 2 54 574 596  
vncdesktopsink.cpp : OOOOOOOOOOOO 49451 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 684 738 577 595  
vncmenu.cpp : ############### Usernames change: old="VetStation", new="VetStation"
 --Overlapped I/O operation is in progress.
Wed Jul 12 14:23:20 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 275 1587872758
Wed Jul 12 14:23:21 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 275 1587872758
Wed Jul 12 14:23:22 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 275 1587872758
vsocket.cpp : zero bytes read1
vncservice.cpp : SelectHDESK to Default (28) from 28
vncclient.cpp : client disconnected : 52.6.118.201 (1)
vncclient.cpp : kill update thread
 --Overlapped I/O operation is in progress.
vncclient.cpp : update thread gone
vncserver.cpp : removing authorised client
vncserver.cpp : deleting desktop server
vncdesktop.cpp : ~vncDesktop 
vncdesktopsink.cpp : ~vncDesktop::Tell initwindowthread to close 
vncdesktopsink.cpp : OOOOOOOOOOOO 18 0
vncdesktopsink.cpp : OOOOOOOOOOOO called wm_quit
vncdesktopsink.cpp : Unsethooks OK
 --Access is denied.
vncdesktopsink.cpp : WM_DESTROY
vncserver.cpp : KillAuthClients() done
vncdesktopthread.cpp : quitting desktop server thread
vncdesktopthread.cpp : quitting desktop server thread:SetBlockInputState
 --The system cannot find the file specified.
vncdesktopthread.cpp : quitting desktop server thread:ClearShiftKeys
vncdesktopthread.cpp : quitting desktop server thread:g_DesktopThread_running=false
 --The system cannot find the file specified.
vncdesktopsink.cpp : ShutdownInitWindowthread 
vncservice.cpp : SelectHDESK to Default (28) from 28
Windows 7 log sample:

Code: Select all

Wed Jul 12 14:37:59 2017
HideDesktop.cpp : Killwallpaper 1
vncmenu.cpp : DisableAero 0 
vncmenu.cpp : ############### Usernames change: old="Admin", new="Admin"
 --The system cannot find the file specified.
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 0 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 275 4457284
Wed Jul 12 14:38:00 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 0 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 275 4457284
Wed Jul 12 14:38:01 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 0 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 275 4457284
Wed Jul 12 14:38:02 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 0 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 275 4457284
Wed Jul 12 14:38:03 2017
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 0 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 275 4457284
Wed Jul 12 14:38:04 2017
HideDesktop.cpp : Killwallpaper 1
vncmenu.cpp : DisableAero 0 
vncmenu.cpp : ############### Usernames change: old="Admin", new="Admin"
 --The system cannot find the file specified.
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 0 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 275 4457284
Wed Jul 12 14:38:05 2017
vsocket.cpp : zero bytes read1
vncservice.cpp : SelectHDESK to Default (48) from 48
vncclient.cpp : client disconnected : 52.6.118.201 (1)
vncclient.cpp : kill update thread
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 0 1024  
vncdesktopsink.cpp : OOOOOOOOOOOO 49601 0
vncdesktopsink.cpp : RFB_SCREEN_UPDATE  
vncdesktopsink.cpp : REct3 0 1280 996 1024  
vncclient.cpp : stopping update thread
client sent 1012 updates
vncclient.cpp : update thread gone
vncserver.cpp : removing authorised client
vncserver.cpp : deleting desktop server
vncdesktop.cpp : ~vncDesktop 
vncdesktopsink.cpp : ~vncDesktop::Tell initwindowthread to close 
vncdesktopsink.cpp : OOOOOOOOOOOO 18 0
vncdesktopsink.cpp : OOOOOOOOOOOO called wm_quit
vncdesktopsink.cpp : Unsethooks OK
 --Access is denied.
vncdesktopsink.cpp : WM_DESTROY
vncdesktopsink.cpp : OOOOOOOOOOOO end dispatch
 --Invalid window handle.
vncdesktopsink.cpp : ~vncDesktop:: iniwindowthread proper closed 
Wed Jul 12 14:38:06 2017
vncserver.cpp : KillAuthClients() done
vncdesktopthread.cpp : quitting desktop server thread
vncdesktopthread.cpp : quitting desktop server thread:SetBlockInputState
vncdesktopthread.cpp : quitting desktop server thread:ClearShiftKeys
vncdesktopthread.cpp : quitting desktop server thread:g_DesktopThread_running=false
vncdesktopsink.cpp : ShutdownInitWindowthread 
vncservice.cpp : SelectHDESK to Default (48) from 48
Any help would be appreciated. Thanks!
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Early UVNC connection timeout on idle connection

Post by Rudi De Vos »

Are you talking about a server<->viewer timeout
or
server <->repeater timeout before viewer is able to connect
ppatenaude
Posts: 3
Joined: 2017-07-13 12:27

Re: Early UVNC connection timeout on idle connection

Post by ppatenaude »

The viewer is able to connect through the repeater. I am able to interact with the server. If I stop interacting with the server and no subsequent screen updates happen, then it closes in a few minutes.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Early UVNC connection timeout on idle connection

Post by Rudi De Vos »

Looks like a server recv() timeout "zero bytes read1"
ppatenaude
Posts: 3
Joined: 2017-07-13 12:27

Re: Early UVNC connection timeout on idle connection

Post by ppatenaude »

We have a load balancer between the server and the repeater (but only one repeater). I believe that when there is no activity going through, it closes the socket. Would that cause the recv() timeout? Is there a configuration option that would prevent it from timing out within an hour (similar to the KeepAliveInterval)?

If we make the load balancer stay alive for an hour that would fix the issue, but it wouldn't prevent other infrastructure that we don't have control over from closing the socket.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Early UVNC connection timeout on idle connection

Post by Rudi De Vos »

While idle and viewer in debug i see the viewer sending and receiving keepalive packets

viewer send keepalive to server every 5 sec
server send keepalive to viewer every 60 sec

test:
repeater + encryption
server is US, viewer in EU

line was still open after 1 hour.
Post Reply