-
Winsock problem
Well I have been working a small project and it requires communicating between programs that are in different computers. So I wanted to test winsock before I started putting it in my program.
I have downloaded lots of sources that are very basic client server chats and followed tutorials, but still they don't work.
They work on my own computer, but if I send the client or the server to my friend, it doesn't work.
So is it even possible to get winsock to work?
For example I enter a value (x=5000) and my friend who is running the same program on his computer can see that I entered 5000.
Or is there a more simple way for 2 programs to interact with each other on different computers?
Thanks a lot.
-
Re: Winsock problem
Winsock will work if your friend is on a local network (I have done this myself), but if you and your friend are connecting through the internet then there is another whole complicated side of port forwarding, which could be your problem.
An alternative to port forwarding is a program called Hamachi, which connects two or more computers over the internet as if they were on a local network.
Both users have to have the program for this to work though.
-
Re: Winsock problem
It all depends on what connects your computers to the internet. If the computer's IP starts with 10, 172.16 - 172.31 or 192.168, you're using network address translation, so the router doing the translation has to forward the port to the computer that's running the program that's waiting for the connection (the "server").