errno 107 socket.recv issue

Steve Holden steve at
Tue Feb 9 15:30:55 CET 2010

Jordan Apgar wrote:
> I have a simple tcp server and client where the server sits and waits
> for a message and then processes it, my client sends its first message
> to the server.  On the server I receive:
> socket.error: [Errno 107] Transport endpoint is not connected
> when calling
> msg = self.socket.recv(self.buffer)
> My client receives the error:
> socket.error: [Errno 104] Connection reset by peer
> when calling
> msg = self.socket.recv(self.buffer)
> I was working on the server and client over the weekend and sending
> and receiving worked fine, I wanted to debug a few things and I get
> this when I try to run it (no changes made from what I had on the
> weekend)

My car has this problem. It makes a noise when it rolls along the road.
I've brought the wheel for you to take a look at, can you fix it,
please? ;-)

A little more context might be helpful - at least the error traceback
and the code that makes the socket calls. I presume you are using TCP
judging by the client error message. This implies the server isn't
listening. Have you correctly bound the socket to an IP address and port
before issuing an accept() call?

Steve Holden           +1 571 484 6266   +1 800 494 3119
PyCon is coming! Atlanta, Feb 2010
Holden Web LLC       

More information about the Python-list mailing list