Jeff Plotzke Posted March 22, 2006 Report Share Posted March 22, 2006 I'm having a problem where I'm trying to connect via TCP/IP and TCP Connect gives me error 42 (Generic Error). I have 5 different TCP connections simultanously, and normally, my program will work OK for the first several runs of the program. I always make sure to do a TCP Close before I exit the program. Then, after about the 4th or 5th time running the program, all TCP Connects will give error 42 without any wait (I have 10 sec timeout wired)... Subsequent times will yield the same results. During this time, I can ping the other IPs that I'm trying to connect to OK and I can even connect to them with other programs (non-LV). I'm using LV 8.0, so maybe this is a new feature... It seems as if LV stops handling TCP/IP connections after a while. Has anyone else seen this before? Thanks! ~Jeff Quote Link to comment
David Wisti Posted March 23, 2006 Report Share Posted March 23, 2006 I have not seen this problem before but are you using something other than 0 for local port on TCP open? local port is the local connection port. Some servers only allow connections to clients that use port numbers within a specific range that is dependent on the server. If the value is 0, the operating system selects an unused port. Quote Link to comment
Jeff Plotzke Posted March 23, 2006 Author Report Share Posted March 23, 2006 I have not seen this problem before but are you using something other than 0 for local port on TCP open? No, I have that input unwired. Hmm... I wonder if that may be the problem -- After a number of runs of the program, Windows starts giving out local ports which are out of range for the other computers. Is that possible? Would I be ok to give the same Remote Port and Local Port? Quote Link to comment
David Wisti Posted March 23, 2006 Report Share Posted March 23, 2006 Would I be ok to give the same Remote Port and Local Port? I would say no, its always a good idea to let the OS pick the local port. I've run into problems when the OS did not close a local port I was trying to use again. Quote Link to comment
David Boyd Posted March 23, 2006 Report Share Posted March 23, 2006 No, I have that input unwired. Hmm... I wonder if that may be the problem -- After a number of runs of the program, Windows starts giving out local ports which are out of range for the other computers. Is that possible? Would I be ok to give the same Remote Port and Local Port? A good free tool that I've used in the past for troubleshooting these sorts of problems is TCPview from SysInternals. If the problem really is as you've suggested, TCPview would make this evident by listing lots of connections in the 'CLOSE_WAIT' state, tying up local ports. Just my 2 cents' worth... Best regards, Dave P.S. And no, you don't want to try to use the same port number on both sides of the connection. At least for 'well-known' ports, that would be simply impossible (i.e., you couldn't likely connect to a web server's port 80 and specify port 80 for your end of the connection. Your OS would most probably disallow you from using any of the 'well-known' ports in such a way.) Quote Link to comment
alukindo Posted April 24, 2006 Report Share Posted April 24, 2006 Hi Jeff: I am having the same problem when re-connecting to a TCPIP server using my custom TCPIP client-server VIs. The error manifests as error 42 on the server-side, while it reads as error 64 on the client side. It only happens on the 10th-or-so reconnect. It is repeatable and can be easily reproduced. At present, I am trying to work around it by maintaining the connection open. I use regular polling to ensure that either side of the connection is alive. This particular application needs to run reliably & 'forever' on a real-time PXI system. Otheriwse, were you able to find any other solutions to this problem? Thanks Anthony L 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.