Socket Programming help

Posts 1–8 of 8 · Page 1 of 1
Socket Programming help
So I made a server and a client in C# using sockets. when i run both the client and the server on the same machine it connects. but if i run the server on my machine and the client on someone else's machine on different networks, it won't connect :/ Basically all the program does is say "Connected" if the server and client make a connection. does anyone have any ideas on how to make it work? Thanks!
Quote Originally Posted by itouchlover View Post
So I made a server and a client in C# using sockets. when i run both the client and the server on the same machine it connects. but if i run the server on my machine and the client on someone else's machine on different networks, it won't connect :/ Basically all the program does is say "Connected" if the server and client make a connection. does anyone have any ideas on how to make it work? Thanks!
1- Make sure you are using correct IP's (Not localhost or 127.0.0.1)
2- Make sure that the server has the port which receives the connection open
3- No Firewall blocking..
4- Profit??
1- i checked the corrected IP is used.
2- "TcpListener tcplistener = new TcpListener(IPAddress.Any, 9572);" that opens the server on port 9572 and accepts any IPAddress. right?
3- How would i know?
4- As of now no but i have been thinking 'bout it so probably in the near future. why?
Quote Originally Posted by itouchlover View Post
1- i checked the corrected IP is used.
2- "TcpListener tcplistener = new TcpListener(IPAddress.Any, 9572);" that opens the server on port 9572 and accepts any IPAddress. right?
3- How would i know?
4- As of now no but i have been thinking 'bout it so probably in the near future. why?
if you are behind a firewall or a port blocked (Router) which is blocking your outside connections, you never reach the server...
how do i change firewall settings on Windows 7? i'm still getting used to it so i don't know yet! Thanks
Quote Originally Posted by itouchlover View Post
how do i change firewall settings on Windows 7? i'm still getting used to it so i don't know yet! Thanks
open cmd and type in:
IPCONFIG

Find your Default Gateway, and then paste ur gateway on the browser's url tab...
Your default gateway should be:
Code:
192.168.1.1
and the username & password: admin
Then you have to forward the port manually.

Edit:
I made a vid to forward ports sometimes ago.. It's for Modern Warfare 2, but the way is the same, you have only to change the port number...
its not necessarily your windows firewall.. but might be router one too. (and ports, don't ignore this...)
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us