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

Help with sourcecode - what controls connection timeout?

Post Reply
kellycomputerservices
Posts: 3
Joined: 2009-11-19 14:30
Location: Merseyside, UK
Contact:

Help with sourcecode - what controls connection timeout?

Post by kellycomputerservices »

Hi,

Hopefully Rudi will be able to help me here...

I have re-coded the PCHelpware SC Gui to display its Balloon text in a seperate modeless dialog box instead of IDC_TITLEWINDOW which works perfectly, however, can you tell me where the timeout is controlled if the viewer doesn't connect to the repeater? Is it the repeater, 1SCDLL.dll or other? Does this issue a Stop_server function through the dll?

I think it times out after 5-6 minutes (server removed from repeater), but DialogBoxParam(hInstance, MAKEINTRESOURCE(IDC_DIALOG), NULL, (DLGPROC)DialogProc,0); just sits there as if it hasn't received the command to goto WM_APP+1 (waiting_for_quit).

I'm a newbie to coding (appologies if I'm using wrong programming terminology), so maybe I just need to call things differently in the source, or maybe I'm doing it wrong. I tried creating a loader/wrapper dialog and call IDC_TITLEWINDOW and the modeless dialog from there, but that didn't work.

I hope you can help! (and I hope this makes sense) Thanks :)

Keith.
Last edited by kellycomputerservices on 2009-11-19 14:46, edited 1 time in total.
kellycomputerservices
Posts: 3
Joined: 2009-11-19 14:30
Location: Merseyside, UK
Contact:

Re: Help with sourcecode - what controls connection timeout?

Post by kellycomputerservices »

OK I found that it's the repeater that controls the timeout

Code: Select all

if (tick-Servers[i].timestamp>300000 && Servers[i].used==false && Servers[i].code!=0)
- 5 minutes

It seems to me then that 1SCDLL.dll isn't detecting the disconnected socket (server removed from repeater), and passing the relevant command back to the server gui to terminate.

Further I found this thread [topic=9606][/topic] explaining a ittle more about the DLL functions.

This still doesn't really help though. I'm sure it's something to do with the way 1SCDLL.dll interperets a socket disconnect, and how it passes (or doesn't in my case) it back to the GUI.

Any ideas?? (I'm learning all the time here as a newb)

Thanks.
kellycomputerservices
Posts: 3
Joined: 2009-11-19 14:30
Location: Merseyside, UK
Contact:

Re: Help with sourcecode - what controls connection timeout?

Post by kellycomputerservices »

OK I got around it by adding a SetTimer on the enter id dialog IDOK button and a WM_TIMER to the callback. (I'm about to add it to other places if -DIRECT or (!entercode) etc)

If the viewer connects, then WM_APP+3 calls KillTimer function. If no viewer connects, WM_TIMER calls stop_server, and the program closes gracefully (WM_APP+1) and no longer just sits there.

Thereofre my questions have been answered, and now I have all of my balloon text in a seperate dialog which works perfectly!

Not bad for a newb programmer ;)

I've also been adding the Info dialog from the non-SC version, with some success. I have the dialog, and the LEDs both work, but the list doesn't show any status. Presumably because I'm not using -ask, -passwd etc, or because I have another List showing all of my SC connections. I'm going to play some more and see what I can do!

Cheers.
Post Reply