IP of server in socket

hello!
i'm beginner and need your helps.
i've wrote a program that uses socket to connect to it's client but after writing all the code, I don't know what ip i should set to my bind ipaddr, is that should be my internet ip?

thanks!
you can work on your program just fine without worrying about ip addresses, just on your computer ofc. Or you can set the "test ip" 127.0.0.1 for testing purposes.
i tested it but i want to check it on different computers
Last edited on
Then, yes I believe you need to assign your own IP address.
i did that but it couldn't bind!!
Are the two computers on the same LAN? Then make sure you use the local IP.

Are the two computers communicating over the Internet? Then you have to make sure to use the global IP address, but it still might not work depending on how the computers are connected. If one of the computers are behind a router with NAT then you might have look into port forwarding to make it work.

http://en.wikipedia.org/wiki/NAT
http://en.wikipedia.org/wiki/Port_forwarding
if i set ip address INADDR_ANY what will happen?
Topic archived. No new replies allowed.