Software caused connection abort: recv failed  错误

@Override
public void run() {
// TODO Auto-generated method stub
ObjectInputStream ois = null;
ObjectOutputStream oos = null;
try {
ois = new ObjectInputStream(socket.getInputStream());
oos = new ObjectOutputStream(socket.getOutputStream());
CommandTranser cmd=(CommandTranser) ois.readObject();
cmd=execute(cmd);
oos.writeObject(cmd);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
try {
if(ois!=null)
ois.close();
if(oos!=null){
oos.close();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

}


if(ois!=null)
ois.close();
if(oos!=null){
oos.close();


这行代码删除试试~

虽然使用了资源 在关闭很正常   可是就会报错  试了好久  这样成功了