souske Posted February 21, 2008 Report Share Posted February 21, 2008 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. Quote Link to comment
Phillip Brooks Posted February 21, 2008 Report Share Posted February 21, 2008 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 Quote Link to comment
souske Posted February 22, 2008 Author Report Share Posted February 22, 2008 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? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.