473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

socket object, connection refused ...

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
---
"You can either be part of the problem or part of the solution, but in the end, being part of the problem is much more fun."


Jul 18 '05 #1
2 6269
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.

--
René Pijlman
Jul 18 '05 #2
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
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: anuradha.k.r | last post by:
hi, i have written a simple socket program in python to connect to a windows machine.On the server side i am running a windows socket program which works perfectly fine,my server program waites at...
5
by: cody | last post by:
Hi I'm created a socket listening on port 1234 (it is shown that this post is in listening mode if I use NETSTAT). Now Iam trying to connect to this port: IPHostEntry entry =...
5
by: Russell Warren | last post by:
Does anyone know the scope of the socket.setdefaulttimeout call? Is it a cross-process/system setting or does it stay local in the application in which it is called? I've been testing this and...
4
by: anonymous_c | last post by:
Hey guys. I'm creating a file transfer app. Anyways, I'm using this code... SERVER <code>Dim Hostname As String = Dns.GetHostName Dim IP As String =...
0
by: =?Utf-8?B?QWxwZXIgQUtDQVlPWg==?= | last post by:
Hello, First of all I wish you a good day. My help request is about .NET asynchrounus socket communication. I have developed Server-Client Windows Forms .NET applications in VC++ .NET v2003. I...
6
by: Diego F. | last post by:
Hello. I'm writing an application that manages sockets and has a message protocol. I connect to another machine and I have to send and receive certain messages. I need the possibility to...
2
by: Nicolas Le Gland | last post by:
Hello everyone here. This is my first post in this newsgroup, I hope I won't be to much off-topic. Feel free to redirect me to any better group. I am getting strange timing issues when...
2
by: Mirko Vogt | last post by:
Hey, it seems that the socket-module behaves differently on unix / windows when a timeout is set. Here an example: # test.py import socket...
3
by: TsanChung | last post by:
I want to make a java TCP socket client to communicate with a TCP server socket on linux. Are there some sample C unix server and java client socket programs available? The Richard Stevens'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.