07-07-2009 11:06 AM
Hi all,
if i use the tcp listen and tcp read blocks with a time out of -1, how can i stop their execution if they are waiting for incoming connection or data?
The tcp read block is in a while loop and the stop button state isn't evaluated, since the read block is in wait.
some one can tell me a solution to this problem compatible with S-RIO target device?
thanks
Solved! Go to Solution.
07-07-2009 11:08 AM - edited 07-07-2009 11:09 AM
Hi giac82,
create your own connection to this port. You can then stop your program, because the listener isn't waiting anymore.
Mike
07-08-2009 02:26 AM
i try to explain better with an example.
1) run the server
2) run the client
3) try to stop the server without stopping the client --> the server never stops due to the infinite timeout on the reader.
note: the client doesn't close the connection after sending "hallo" 4 times.
the question is: is it possible to have the server waiting for data and the stop but evaluated when pushed?
07-08-2009 02:46 AM
Hi giac82,
i know that you only want to close the server. You can create your own connection to the listener. You need another loop for it.
See the attached picture. It's only a small example. You can make it more complex to react on different statuses.
Mike