Avoid Windows Firewall popup with sockets on localhost

断了今生、忘了曾经 提交于 2019-12-03 06:22:22
Vineet Reynolds

Use the three parameter constructor of the ServerSocket class to specify the IP address as well that the server it should listen on. That way you can restrict the server to listen only on 127.0.0.1, unlike the default of 0.0.0.0. See this related Stack Overflow question, for more details.

It is preferable to use InetAddress.getByName(null) to obtain the local address.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!