[Tutor] Socket not connecting

Alan Gauld alan.gauld at btinternet.com
Wed Oct 19 10:33:59 CEST 2011


On 19/10/11 00:26, Jacob Bender wrote:

> worked on my computer, and executed perfectly.

OK, So it probably a networking config issue.

> running the host program. The host program did absolutely nothing and my
> IP was programmed into the client as the "Host IP".

Is it a DHCP generated IP address created by your router/swuitch or is 
it the IP address assigned by your internet service provider?

Your friend will only see the external one.

> I've been using port 80 the whole time.

While it shouldn't affect whether it works or not you probably should 
use another port. Port 80 is the "well known port" for http web traffic. 
It's better to avoid low numbered ports and go for
something above 2000

 > the source code for both the server and the client I was talking about:

They look ok and if they worked with localhost on your PC then they 
should work over the wider network. (I might try increasing the listen 
value to say 3 or 5 but it shouldn't really be necessary)


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list