09-12-06 06:26 PM
Oliveira wrote:
> I have a Linux server (FC3) with 3 application that collects several
> data from 3 equipments using sockets.
> These 3 application are restarted (killed and start) each 15 minutes.
> Several hours later, when restarting the application, I get a
> 'Connection refused' error (in the 3 application).
> After this error if we reboot the server everthing goes OK. After
> several hours the same error happens.
> Does any one has an ideia how to find what is causing this kind of
> problema?
When you get a 'connection refused', it usually means that nothing is
listening on the port you're trying to connect to. There are many
reasons this can happen.
First, check to make sure that the program that listens on that port is
actually running. Then check to see if it has a socket bound to that
port (with 'netstat' or a similar tool). Then check to make sure it
hasn't hung or crashed.
Also, make sure the application will not start up if it fails to bind
to its primary port (the one that you're connecting to). At an absolute
minimum, log the inability to bind to the port on startup and see if
that log entry coincides with your problem.
In other words, troubleshoot the error condition and narrow it down. If
I had to take a total guess, I'd guess that it's a combination of not
setting SO_REUSEPORT and not being diligent in attempting to 'bind' on
startup.
DS
[ Post a follow-up to this message ]
|