Jump to content

TCP Connect gives Generic Error


Recommended Posts

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

Link to comment

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.

Link to comment
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?

Link to comment
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.)

Link to comment
  • 1 month later...

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.