当客户端关闭后服务端马上出异常 public void run(){
while(!flag && !socket.isClosed()){
try {
msg = in.readObject().toString();  指这行
ServerMain.jTextArea_Msg.append(msg+"\n");
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}