Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Networking (CSocket) troubles... 1

Status
Not open for further replies.

classT

Programmer
Oct 6, 2002
19
US
Hi all,

I have been experimenting with the CSocket class and have built a small client program and small server program which I have tested on two separate PCs over an internet connection.

One of the PCs is running Windows XP and the other Windows95. When I set up the client on the XP machine and the server on the Win95 machine everything works great!

When I do it the other way around, the connection ALWAYS times out!!!!

Also, I have tried to 'ping' the XP machine from the Win95 machine and that times out too so I'm convinced it's not my code.

I have the IP address and port numbers set up correctly - there is no doubt. But... I think it's got be some kind of setting or something on the XP machine that's causing incoming connections to time out like this - even 'pings'.

Does anyone (with some networking experience) have any clue what may be happing here????

Many thanks in advance

PS: What I don't understand is that windows messaging and some online games don't seem to have a problem communicating with the XP machine but a simple 'ping' does not work!
 
The reason is that you have the XP firewall running on the XP machine. You either have to instantiate the connection from the XP machine to the Win95 machine first OR, if you want to instantiate the connection from another machine first, you need to know the IP address of the machine that is making the call (this obviously means that you somehow have to instatiate the connection from the XP machine anyway to be able to supply the IP address!).

This means that you'll have to supply a valid SOCKADDR in the CSocket::Accept() function. The SOCKADDR structure needs to contain the IP address of the computer that is attempting to connect to the host.

[rockband]
tellis.gif

[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]​
 
FANTASTIC!!! It works like a charm!! Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top