简体   繁体   中英

Java Sockets : What IP address should I use?

I am making a java chat application with a server and client. I have the code working when I connect the client to the server using 127.0.0.1 and port 1234, but when i change the IP to my actual IP address, it doesn't seem to work. Could anyone tell me what IP I should use and how to get it, to make sure I am using the correct address.

Make sure that you are running a port that isn't blocked. 80 is a good bet

On command line, try

ipconfig /all

and search for the interface which are you using. There you will find the ip your are searching for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM