Connecting to Self
I'm playing around wtih Johnnie's Winsock tutorials ( http://johnnie.jerrata.com/winsocktutorial/). I'm trying to connect to myself via the client while the host is running. So I'm using 127.0.0.1. But when i try to connect, i get a winsock error that the connection was refused? I'm new to this and was wondering if anyone could help. Thanks.
You're probably connecting to the wrong port. The server needs to bind to a known port (say, 54321), and the client needs to connect to that specific port. 127.0.0.1 is like a street name ("your computer") -- you also need the right house number to connect.
Btw: ports should be passed through htons() before being passed to bind() or connect().
Btw: ports should be passed through htons() before being passed to bind() or connect().
enum Bool { True, False, FileNotFound };
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement