LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Error 66 in TCP listener

Hi,

 

I am creating a TCP listener in one of the client PC, After sometime I get TCP error 66 from the TCP listener, and in that case I am trying to re-create the listener with the same socket number but its always timed out and I never get an active connection.

 

So, can anyone suggest that if the TCP connection is opened in server and the listener loses the connection in the client, for getting an active listener, do I need to close and open the server TCP connection again ?

0 Kudos
Message 1 of 7
(4,520 Views)

It would be very helpdful if you could post your code.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 7
(4,498 Views)

Hi Mark,

 

Its not possible to post the code. First thing I want to know is

> If TCP listener loses a connection, then is it possible to regain it without closing the TCP Open connection.

0 Kudos
Message 3 of 7
(4,478 Views)

@RJ_15 wrote:

Hi Mark,

 

Its not possible to post the code. First thing I want to know is

> If TCP listener loses a connection, then is it possible to regain it without closing the TCP Open connection.


No, once a connection is lost you need to reestablish a new connection.

 

You could post a simplified verion of your client/server so we can see how you are managing things. It is really difficult to give advice or identify problesm with code without seeing it.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 7
(4,469 Views)

At least to me it's not clear at all what you are trying to do, and I'm sure I'm not the only one, so some sample code showing your problem really would go a long way into helping yourself.

 

For one thing the TCP Listen doesn't maintain a connection at all but simply opens a socket to receive a connection and hands it back to your code to do whatever you want to do on that connection. As such TCP Listen can not really "loose" a connection with a timeout error. So either you have a timeout on the TCP Listen and the listen timeouts waiting for a connection to arrive, or you use TCP Read and/or Write to do something on the connection and get the timeout error there.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 7
(4,460 Views)

Here is the attached Sample VIs.

The Server VI is opening the TCP connection and the Client VI is creating a listener to it.

The problem is, if any TCP error comes in Client VI, after closing the connection I am trying to listen to the same port again. But its not able to create an active listener again.

 

Hope this makes sense.

 

 Runjhun

Download All
0 Kudos
Message 6 of 7
(4,416 Views)

First, your termanology is incorrect. In networking servers are the process that listen for connections and clients are processes that connect to a server. You are reversing the roles of your processes.

 

As for your specific questions you are not doing any error processing which will have the server (what you are calling the client) go back into a listening state for a new connection. Here is some basic code which demonstrates a server which will handle a single connection but will go back and wait for a new connection if the client disconnects or the connection is lost. It also demonstrates some very basic data transfer between the two processes.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 7
(4,407 Views)