Socket Soc=new Socket("whois.internic.net",43);//Creating a Socket.
InputStream In=Soc.getInputStream(); //Getting Input Stream
OutputStream Out=Soc.getOutputStream(); //Getting Output Stream
String Str="MHProfessional.com";
Out.write(Str.getBytes());
int c;
while((c=In.read())!= -1) { //this is line 11!..Commenting it out works fine.
System.out.print((char)c);
}
Soc.close();我该怎么解决。它在eclipse和jdk上给出了同样的错误。
发布于 2014-10-13 12:23:17
WHOIS请求由\r\n终止。您的请求是不合法的,因此对等方正在关闭连接,甚至可能重新设置连接。或者那台服务器不能为你的客户服务。
https://stackoverflow.com/questions/26339060
复制相似问题