VNC Traffic killing thread

Hi all,
Me again with more basic questions. I’m trying to get the VNC to work, but i’m running into issues with stuff happening under the hood I don’t have access to. I borrowed the source code off of github so I could step through and see what was going on, but I’m having issues with the thread that runs the VncServer object permanently suspending on its own - there are no function calls to suspend this thread for more than a few ms at a time, but it seems after heavy traffic (moving the mouse around mostly) the thread will kill itself and will not restart. If i don’t move the mouse onto the screen, it works great, but as soon as it’s getting a bunch of mouse data it quits. All my code is using is the demo code on github with a little extra stuff to run a physical screen.

The objects still think they’re connected and open, but their code isn’t being executed so the VNC viewer will lose connection. Where should I start looking? troubleshooting multithreaded code is a bit of a bear. it’s also slowing my main thread to a crawl when it is in this state, so my best guess is there is some blocking call somewhere, but I don’t understand why that would keep my main thread from running too - especially when these are the only two running threads and one is suspended.

Edit - I learned that the ethernet port itself is also running on another thread, would that have any bearing on this?

We will take a look.

There is a property DelayBetweenFrame that you can use as suspend, by increase this value.

No dice, unfortunately even on a 2-3 second interval it still doesn’t behave. I don’t think its with the VNC drivers. Even with the mouse data taken entirely out of the logic beyond just reading the data from the stream, it will still cause it to crash. There’s no exception or anything, it just quits working.

Unplug your mouse! I am joking of course. Do you want to create a GitHub issue?


Also @Dat_Tran here’s video if you want a better reference.

This is not hard to fix, so don’t worry.

1 Like