Java ServerSocket

扫码查看
本文介绍了Java ServerSocket的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的本​​地计算机的IP是192.168.1.93.路由器的IP(WAN)为74.220.XXX.XXX.我尝试创建服务器并绑定到WAN.

serverSocket =新的ServerSocket(80,100,InetAddress.getByName("71.160.XXX.XXX"));

然后出现异常错误:java.net.BindException:无法分配请求的地址:JVM_Bind

为什么?有任何解决方案吗?

My local computer''s IP is 192.168.1.93. The router''IP (WAN) is 74.220.XXX.XXX. I try to create a server and bind in the WAN.

serverSocket=new ServerSocket(80, 100, InetAddress.getByName("71.160.XXX.XXX"));

and then I get the exception error: java.net.BindException: Cannot assign requested address: JVM_Bind

why? have any solution?

推荐答案


这篇关于Java ServerSocket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 05:06
查看更多