Re: Sockets: connection refused



David Schwartz wrote:
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.

In addition to said, it might be a resource leak in the server. On
linux the default limit of open file descriptors may be 1024, the
server might me running out of the them neglecting to close file
descriptors, so that accept fails and RST is sent back to the client,
which causes connect fail with ECONNREFUSED.

.



Relevant Pages

  • Re: network programming: how does s.accept() work?
    ... The program you contact at Google is a server. ... so, the server will usually assign a new port, say 56399, specifically ... connections to a server remain on the same port, ... sockets is what identifies them. ...
    (comp.lang.python)
  • Re: Socket switch delay
    ... hadn't realized the bit about the completion port... ... > can come back with partial buffers from a completion io. ... > in the client and server. ... > remember changing in the server was the "non-blocking sockets" together ...
    (microsoft.public.win32.programmer.networks)
  • Re: Router/Firewall Port Mapping Question
    ... Sockets on the PC can be client or servers. ... The port number is usually selected by the ... and a Server on the other. ...
    (comp.security.firewalls)
  • Re: How do you close a port immediately?
    ... >> I'm playing around with sockets at the moment. ... >> After the server is launched, it will be there sitting like a duck ... But netstat shows that port ... IT Specialist, Enterprise Data Systems, ...
    (comp.unix.programmer)
  • Re: Sockets: connection refused
    ... data from 3 equipments using sockets. ... Several hours later, when restarting the application, I get a ... check to make sure that the program that listens on that port is ... make sure the application will not start up if it fails to bind ...
    (comp.unix.programmer)