LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Connection when 'Abort Execution' button pressed

I know that the Abort button is generally a no-no for stopping execution of an application, but I'm just trying to be as safe as possible.
 
I've been working on a client-server application in LabVIEW (7.1) for a while, and have run into an issue where the server, occasionally, won't recognize that the connection was closed. This only occurs when the client terminates using the 'Abort execution' button and happens maybe once in every 10 tries. What happens is, instead of generating an error 66, 1, or other common error, I continually get timeouts from the TCP Read. Any insight?
 
In the meantime I've just implemented a timeout and forced the client to send the occasional ping, which works but isn't my ideal solution.
 
Thanks
0 Kudos
Message 1 of 3
(3,230 Views)

How about not letting the client use the Abort button by hiding it? That would be a good move in general.

Regardless of that, if you want to make sure that the connection has really stopped then you will have to use the periodical ping you mentioned. Consider what would happen for example if you disconnected the physical connection. There would be no termination of the connection, but the server should recognize that it's gone. The ping is a common and legitimate solution.


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(3,222 Views)
Yeah, you're right. I didn't think about the case of the physical connection.  Anyway, thanks. I'll keep the ping and hide the abort.
0 Kudos
Message 3 of 3
(3,215 Views)