tcp server ip address

让人想犯罪 __ 提交于 2019-12-02 01:11:39

问题


When starting H2 tcp server and the host pc has multiple IP address's how can I define the IP that the server is going to bind to listen for connections ? We can define the tcp port but there does not seems to be a way to define the ip address. Thank you, Oscar


回答1:


http://www.h2database.com/html/advanced.html#server_bind_address

Usually server sockets accept connections on any/all local addresses. This may be a problem on multi-homed hosts. To bind only to one address, use the system property h2.bindAddress. This setting is used for both regular server sockets and for SSL server sockets. IPv4 and IPv6 address formats are supported.



来源:https://stackoverflow.com/questions/8319345/tcp-server-ip-address

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