socket object, connection refused ...

  • Thread starter Maxim Olivier-Adlhoch
  • Start date
M

Maxim Olivier-Adlhoch

hello ,

this is my first post on this list. I've been told its very helpfull, I hope someone can help me with my problem.


I've been building a specialized client server application using the socket object.

I am on a variety of windows (NT 2000 XP).

I've been coding the engine, using local host on server and client for 2 months ALL is going ok. never had any tcp/ip problems.

now I decide to share the server and start doing actual network tests and the server always refuses to have a client connect.

I have snooped the network traffic and it does reach the remote machine. Only, the server always send a RST (reset) message back and this causes my client script to display a connection refused message.

so I decided to test using the machine locally in different ways:

using 'localhost' or '127.0.0.1' always works, using my actual machine's ip or its hostname does not!!

I've tried all kinds of different server port (above and below 1024, 10000, 50000) but I have the same problem each time.



-MAx
 
R

Rene Pijlman

Maxim Olivier-Adlhoch:
using 'localhost' or '127.0.0.1' always works, using my actual machine's ip or its hostname does not!!

What is the server socket binding to?

"Connection refused" normally means there is no server listening for
connections on the specified IP/port-combination.
 
D

Diez B. Roggisch

Hi,
using 'localhost' or '127.0.0.1' always works, using my actual machine's
ip or its hostname does not!!

I had the exact problem last week - I think there should be an update to the
docs, as these say:

<quote from socket example>
# Echo server program
import socket

HOST = '' # Symbolic name meaning the local host

</quote from socket example>

Unfortunately, this is not right - what happens wheny you bind localhost or
127.0.0.1, the socket _only_ listens on your local loop back device. When
binging to '', this means "bind to all IPs of this machine" - and thats
exactly what you are looking for.

So try to either explictely bind to your IP, or '' - that will help.

Regards,

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top