Client disconnection detection

Forums / NoMachine for ARM / Client disconnection detection

  • This topic has 3 replies, 2 voices, and was last updated 1 month ago by AvatarGega.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #25258
    Avatarlipigl
    Participant

    Hi!

    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?

     

    Thanks!

    Dario

    #25282
    AvatarGega
    Participant

    Hello lipigl,

    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:
    ProxyExtraOptions limit=256k,link=modem,timeout=5

    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:
    UserScriptBeforeSessionClose
    UserScriptAfterSessionClose
    UserScriptBeforeSessionDisconnect
    UserScriptAfterSessionDisconnect
    UserScriptBeforeSessionFailure
    UserScriptAfterSessionFailure

    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.3

    #25294
    Avatarlipigl
    Participant

    Hi Gega,

    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’?

    Regards,

    Dario

    #25314
    AvatarGega
    Participant

    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?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.