05-24-2006 05:48 PM - edited 05-24-2006 05:48 PM
Message Edited by mmathis2000 on 05-24-2006 05:50 PM
05-25-2006 02:40 PM
Hello,
I’m a little curious why you are setting up your client like this. If it is your objective to just have the client wait until a connection is made, why not just have the TCP connect VI have timeout value of ‘-1’ meaning “do not timeout”. This will allow the built-in TCP event structure to listen for connections and ‘wake up’ your program when a connection is established. I say this, because the error messages seem to be dependant on the timeout values. For example, wire in 1ms to the timeout and see how the messages differ in timeouts as opposed to wiring in “2000” for the timeout value. This is because the Connect VI attempts a connection and waits only the specified timeout before abandoning that attempt and continuing with another attempt. I’m betting in your case connecting to the server takes longer than your timeout value, so the connection is initiated by your LV client, the handshaking takes place, your server indicates that a connection is being made, and sometime during this process your timeout expires and LV tries the process again thus you see the multiple connections. Go ahead and try this as an experiment – take your VI, and instead of using ‘localhost’ use the IP address of your favorite website and change the remote port to port 80. Change the timeout to -1 and wait for the connection, then change the timeout to 1 and see all the timeout errors given.
Hopefully this answers your question, please let me know if you have any additional questions or if this is inaccurate/unclear.
05-25-2006 02:58 PM