One problem is that the timeout method "sets the timeout interval that's used when performing I/O or connecting to a port. When a method doesn't complete within the timeout interval then it's an error and the error mode action is performed." If the remote process isn't going to output something for 7 days then you should disconnect from the socket, sleep(604800) and then reconnect. In other words, lower your timeout value and look elsewhere for the problem.
Another problem is that you assume that the process runs all the time and that there will never be a loss of connectivity. How about checking that the connection still exists before (or when) trying to read from the socket?
In reply to Re: Problem Keeping Socket Alive
by Mr. Muskrat
in thread Problem Keeping Socket Alive
by skamerman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |