while(true){
try{
byte buff[ ]=new byte[1024*1024];//缓冲数组
DataIn.read(buff);
String str=new String(buff);//接受服务器端发送的数据包
ta.append("\n服务器返回消息:"+str);
}catch(IOException ioe){ }
}
你这个while 语句如何没有终止语句,连接断开以后没有了堵塞所以就不停的执行,忘记给while(true) 加终止语句是很可怕的
还有client.close(), 后面的in.close() 是多余的
try{
byte buff[ ]=new byte[1024*1024];//缓冲数组
DataIn.read(buff);
String str=new String(buff);//接受服务器端发送的数据包
ta.append("\n服务器返回消息:"+str);
}catch(IOException ioe){ }
}
你这个while 语句如何没有终止语句,连接断开以后没有了堵塞所以就不停的执行,忘记给while(true) 加终止语句是很可怕的
还有client.close(), 后面的in.close() 是多余的
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货