5黑马币
try {
System.out.println(3);
oos=new ObjectOutputStream(client.getOutputStream());
sperson sp=new sperson();
System.out.println(4);
sp.setName("aaaaaaaaaaaaaaaa");
oos.writeObject(sp);
oos.flush(); }
catch (IOException e) {
System.out.println("客户端错误2"+e.getMessage());}
为什么不关闭oos就会报出异常 connect reset加上这个才能正常发送出去
/* finally{
try{
if(oos!=null)
oos.close();
}
catch(IOException ex){
}}*/
|
|