03-06-2009 02:06 AM
Hi, I'm communicating with some UPS-es using LabVIEW, I'm encoding and decoding messages myself. Everything runs fine, but sometimes I loose communication because of error 1 on port 161. Stopping and restarting "fixes" the problem. Now I tried to prevent stopping the software so when a similar error was present I closed the UDP port connection and reopened it. This causes error 60, port already in use. Why in use, I closed the connection? The only way is to restart the application.
Thank you
03-09-2009 03:36 AM
Hi Flori,
I guess you're implementing an UDP server in Labview; I think that when you close the socket, this is not immediately terminated, but the closing procedure is asynchronously handled by the operating system; therefore you reopen the connection before the previously one has been completely shutted down; you could try inserting a pause time in between closing and reopening.
Please let us know if that works.
Have a nice day,
Giorgio
03-11-2009 04:59 AM
Hi Giorgio, obviously I have already inserted a pause of several seconds, 60sec not worked. I will try with a longer one.
Thanks, ciao
07-28-2011 11:56 AM
I've got it to work, but don't quite understand the implementation.
Looking at the example, there are two addresses used. One to open the UDP port and another for the 'UDP Write', then you set your 'connect' address to the UDP write port - it works.
that said, I don't know what or why you open a port at another address. I simply open to my UDP port address -1.
Regards
Jack Hamilton