I am using a web service set to stream. It's being used to stream Server Sent Events (SSE) to a website. Everything works as expected except when the connection ends the VI seems to keep running streaming to no one which also blocks the next connection to the web service from starting the VI and getting the stream. Is there a way to know when a connection has disconnected inside the VI that is streaming?
I've tried just stopping the connection after a set time and make the web client reconnect; however, that introduces a delay in viewing the data when the user is still connected and isn't ideal.
I've also made the web client "poke" a separate web service which saves a time stamp to a global variable that the streaming web service uses to know if the client is still there. This works but requires a lot of extra stuff going on that is a bit of a pain to code and manage for each streaming service.
Ideally, the streaming VI would have a way to know if the client is still listening to that connection. Any ideas? Alternatively, is there a way to make it so multiple connections can be running the same VI at the same time? By default, I find that a running web service on a VI blocks requests for the same VI. Right now my system only allows one user to be logged in so this isn't an issue.