解决:
DatagramPacket packet = new DatagramPacket(msg.getBytes(), msg.length(), toAddress, toPort);
修改为:
DatagramPacket packet = new DatagramPacket(msg.getBytes(), msg.getBytes().length, toAddress, toPort);
2021-11-13 04:04:59
解决:
DatagramPacket packet = new DatagramPacket(msg.getBytes(), msg.length(), toAddress, toPort);
修改为:
DatagramPacket packet = new DatagramPacket(msg.getBytes(), msg.getBytes().length, toAddress, toPort);