0

I have a setup of a SCPI server in a Win7 PC and have 2 other programs talking to it locally(127.0.0.1) over TCPIP socket 5025 and 5029.

This worked well and stable in a fresh PC, but when we moved it into our production lines and the IT dept added their policies and stuff, it became unstable. The PC is connected to the production floor server but both of the programs are running locally in the PC.

The connection tends to be disconnected when there is an idle period. And it takes 5-6times to refreshing the connection to get it back.

I'm not a programmer myself, so I'm hoping to see if anyone here can help with some answers.

Thank you very much!!

Regards, KwanWee.

  • Are the connections coming from the other side of a [NAT firewall](http://en.wikipedia.org/wiki/Network_address_translation)? – sarnold Jun 29 '12 at 02:20

1 Answers1

0

For the timeout issue, you'll probably need to either get IT's help in removing whatever policy is causing the connection to be closed, or work around it by ensuring that the link does not go idle for long enough to timeout. For example, you could periodically execute a command that shouldn't have any effect such as *IDN? or polling some error register (I forget if those clear on read; if they do you will have to use the value in your program)

In terms of the re-connection problem, does your server process continue operating, and using the same listen socket to accept the re-connections? If not - if you are binding a new socket (or restarting the program) - your problem could be a failure to set SO_REUSADDR on the socket.