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() 是多余的