From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reconnect TCP connection

Trying to reopen a TCP connection that has been closed by the client.  I have seached for an example but most posts point the "Reconnect TCP Connection" example but I can't open this because it is LV 5.1.

 

To create the original connection on the server I use TCP Create Listener and then use TCP Wait on Listener, then on the client I use TCP Open Connection.  This works fine, then on the client the user has the ability to close the connection using TCP Close Connection.  I also want the ability to reopen the connection but this isn't working.

 

Is there a curent example of this?  Or what is the process on the server to reopen a connection?

0 Kudos
Message 1 of 6
(3,976 Views)

Hi prh1969,

if the client closes the connection, then you'll see this also on the server side. If this happens you can start you listener again. With this the client can again open a connection to your server.

 

Mike

0 Kudos
Message 2 of 6
(3,971 Views)

Attached the VI. Now you can open it.

 

Christian

Message 3 of 6
(3,967 Views)

I have tried that and if I try to use TCP Create Listener (with the same port #) I get an Error 60 port already in use.  I seen that this has to do with the connection remaining open for about a minute....  The write up for the "Reconnect TCP Connection" example sounded like there may be a solution to this, but as I stated I can't open this example.

0 Kudos
Message 4 of 6
(3,962 Views)

So what version of LV do you use that you cannot open this example?

Tell me and I try to convert it again.

 

Christian

0 Kudos
Message 5 of 6
(3,954 Views)
Christian_m I can open your example, I was replying to Mike S81 and talking about the LV 5.1 example.  I'm looking at your example and trying to decide how it is different frome what I am doing.  A general question, do you have to keep the TCP Listener ID open after the TCP Wait on Listener has returned with the Connection ID, or can you go ahead and close it?
0 Kudos
Message 6 of 6
(3,946 Views)