January 20, 2020 at 08:59 #25258lipiglParticipant
I am running the NX server on a machine with Ubuntu 16.04 and the client on Windows 10.
I am developing an application which runs on the server, and I need it to detect when the NX client connects or disconnects (either because the session was closed, or because the network connection was lost) and do it relatively fast (preferably less than 5 seconds).
I have tried periodically parsing the output of the command ‘nxserver –list’, but the command executes slowly (each execution takes a couple of seconds) and it doesn’t detect the client’s disconnection (due to network connection loss) fast enough.
Is there any other suggested way to check if a client is connected to the server or not? Perhaps some ‘heartbeat’ signal from the client I could monitor?
DarioJanuary 20, 2020 at 12:06 #25282GegaParticipant
The reason that session doesn’t change its status to disconnected, right away, is that agent waits for renewing of connection with a certain timeout. You can modify this timeout by uncommenting ProxyExtraOptions and adding timeout=<seconds> to this key located in node.cfg. e,g:
Also there are number custom scripts that could be set in server.cfg/node.cfg and that are run at certain events, you could use those keys and custom scripts, instead of parsing nxserver –list output. Here are relevant keys:
You can see more information about custom scripts in our documents:
If you use product with virtual desktops: https://www.nomachine.com/DT03O00126#11.4
If you use physical attach only: https://www.nomachine.com/DT02O00125#11.3January 20, 2020 at 16:35 #25294lipiglParticipant
Thanks for the answer!
I have added the argument ‘timeout=5’ to nxnode.cfg, but the server is still taking around 40 seconds to detect a connection drop. Is there any extra configuration I should be adding? Would the UserScripts be executed faster than the time it takes the disconnection to be reflected on the command ‘nxserver –list’?
DarioJanuary 21, 2020 at 09:10 #25314GegaParticipant
Can you tell me exactly which NX version you’re using, and if you’re testing virtual session or physical? Are you sure that you know exactly when connection is dropped?
You must be logged in to reply to this topic.