LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stop tcp listen and tcp read

Solved!
Go to solution

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

0 Kudos
Message 1 of 4
(5,119 Views)

Hi giac82,

create your own connection to this port. You can then stop your program, because the listener isn't waiting anymore.

 

Mike

Message Edited by MikeS81 on 07-07-2009 06:09 PM
0 Kudos
Message 2 of 4
(5,118 Views)

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?

0 Kudos
Message 3 of 4
(5,102 Views)
Solution
Accepted by topic author giac82

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

0 Kudos
Message 4 of 4
(5,100 Views)