Best way to end clients based on client uptime

Hello,

I’m trying to come up with the best way to terminate vision clients that have been up for more than X amount of time - there’s also some condiations based on the open project or window but the duration constraint is the main thing. I know I can use the system.util.getSessionInfo() to get all the clients and when they were created. The ways I was thinking of accomplishing this was either:

  1. Create a gateway timer script that periodically checks the session info to find clients that have been up longer than desired. Send messages to those clients and have the client message handler use system.util.exit to end the client.
  2. Setup a periodic client timer client event script that can somehow check its uptime and then exit when required. I’m not sure what is available that can tell me the uptime here.

Any thoughts?

I would implement this as you’ve suggested in #1. You could probably use system.util.getSessionInfo() in your client timer script and extract your client’s start time from that, but I don’t see any benefit to doing this in the client.

1 Like