gamez Posted September 9, 2006 Report Share Posted September 9, 2006 hello again, i have an opened TCP connection with a remote server which can send me data randomly in the time (it is a chat server) so i need to know which local port is used for the connection in order to use the TCP listen component and so for reading data sent by the server. thank you for your help (ps: i dont want to use static port to solution this problem, i prefer when labview to choose dynamicaly a unused port , and sorry for my poor english) Quote Link to comment
jpdrolet Posted September 9, 2006 Report Share Posted September 9, 2006 hello again,i have an opened TCP connection with a remote server which can send me data randomly in the time (it is a chat server) so i need to know which local port is used for the connection in order to use the TCP listen component and so for reading data sent by the server. thank you for your help (ps: i dont want to use static port to solution this problem, i prefer when labview to choose dynamicaly a unused port , and sorry for my poor english) Once the tcp connexion is opened, the proper function to use is TCP Read. TCP Listen is used to wait incoming connexions from clients. Quote Link to comment
gamez Posted September 9, 2006 Author Report Share Posted September 9, 2006 thanks you for your help. the problem with the TCP read component is that i am obligated to do a while loop to listen if something is coming. isn't it more convenience to wait until something is coming?? thanks again Quote Link to comment
jpdrolet Posted September 9, 2006 Report Share Posted September 9, 2006 thanks you for your help.the problem with the TCP read component is that i am obligated to do a while loop to listen if something is coming. isn't it more convenience to wait until something is coming?? thanks again You have to use a loop anyway to gather the next piece of data so what is the problem? Set a large timeout on the Read function so it won't loop wildly. To abort the waiting Read function close the TCP connection and it will stop immediatly with an error. Quote Link to comment
gamez Posted September 9, 2006 Author Report Share Posted September 9, 2006 you are absolutely right thanks :worship: 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.