java.net.BindException: Cannot assign requested address: connect
报错语句:
Socket socket = new Socket("127.0.0.1", 8092, InetAddress.getLocalHost(), 20001);
修改为下面语句后正常:
Socket socket = new Socket(InetAddress.getLocalHost(), 8092, InetAddress.getLocalHost(), 20001);