Can't connect over internet
I''ve written a basic socket class and it will listen/connect and send/receive data over my LAN just fine. However I cannot connect or receive a connection from my friends machine over the internet. Is there anything specific that needs to be done programming wise to accept a connection over the internet vs over a LAN? The sockets are all stream sockets, initialized thus:
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
Then I bind the server socket to INADDR_ANY and I connect the client socket to the server. Anything here I''m forgetting that would cause it not to work over the internet? Or should I just try some different friends?
TLR
If you''re using cable, does you''re router have a firewall????
-UltimaX-
"You wished for a white christmas... Now go shovel your wishes!"
-UltimaX-
"You wished for a white christmas... Now go shovel your wishes!"
Nope, I wish it was that easy. I''m on a dialup connection, and there''s no firewall or anything.
There is absolutely no difference in the socket''s themselves. Maybe you could be a bit more specific regarding the error(s) you get and what exactly seems to be the problem?
Don''t forget that network addresses and port numbers have to be in network byte order - so use htonl and htons to convert the address and port number respectively.
Other than that I can''t help you without some kind of error code or snippet of your code.
Don''t forget that network addresses and port numbers have to be in network byte order - so use htonl and htons to convert the address and port number respectively.
Other than that I can''t help you without some kind of error code or snippet of your code.
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
When the client tries to connect, it gets a WSAETIMEDOUT error. The machine that's acting as the server is using Win98 SE, and I have internet connection sharing installed on it. Does that do anything that might screw it up? To I need to bind to something other than INADDR_ANY?
CT
[edited by - certaintragedy on November 9, 2003 4:13:20 AM]
CT
[edited by - certaintragedy on November 9, 2003 4:13:20 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement