所以当我的服务器在新客户端连接时向我已连接的客户端发送一些信息时,我会收到此错误。我已逐步完成代码,并且在星号包围的行处发生unknownhostexception错误;
String temp1 = inputMessage.substring(4);
String [] newString = temp1.split(",");
System.out.println(newString[0] + " " + newString[1] + " " + newString[2] + " " + newString[3]);
**InetAddress newAddress = InetAddress.getByName(newString[2]);**
int port = Integer.parseInt(newString[3]);
ClientConnectionInfo user = new ClientConnectionInfo(newString[1], newAddress, port);
有人可以告诉我为什么以及如何解决这个问题?
编辑:所以你知道,因为我已经完成了将字符串转换回inetaddress的方式,所以我可以构建一个类。