Jump to content

TCP Listen not listening


Recommended Posts

Hi

I'm trying to run double loop program. One while loop acquires data the other transfers it via tcp/ip. Both loops are closed in a Flat Sequence Structure.

Before the the sequence I put TCP Listen and set the timeout to -1 (forever). After the FSS I close the TCP connection.

In client that receives the data I open the connection, while loop where I get the data and closing connection after.

It happens that the Listen doesn't wait for the incomming connection. From the observations I see that the source of the problem

might be not properly closed connection, because if I wait a moment I can run it again without a problem.

Does anyone has any idea what might be keeping the connection open eventhough I close it myself?

Is it possible that the error is somewhere else?

I tried to use various ports - the results are the same.

Link to comment

The problem may not be in your LabVIEW code; it may be related to the remote device not freeing ephemeral ports in a timely fashion. The error code might tell you more.

Try using a fixed timeout (5 seconds) and check the error returned from the TCP open.

See these threads from the NI forums...

http://forums.ni.com/ni/board/message?boar...ssage.id=240177

http://forums.ni.com/ni/board/message?boar...=215544#M215544

Link to comment

Thanks for the clues.

The error number I get is 248, which seems not to be described anywhere. I found a flag that does not change the time itself but allows reuse of the port without

waiting. Well setting it doesn't help, but I'm still digging :)

Any ideas on the error?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.