当我尝试使用我的本地IP(而不是localhost)创建套接字时,我收到此错误:
Failed to bind UDP channel to endpoint [/172.25.1.20:11111]
java.net.BindException: Cannot assign requested address: bind
以下是代码:
DatagramSocket dsocket = new DatagramSocket(null);
dsocket.bind(new InetSocketAddress("172.25.1.20", port));
我正在使用Windows 8,我的防火墙已关闭。
任何想法?