socket连接得不到输入流,急救了!!!
Socket s = new Socket("192.168.0.253", 8020);
ObjectOutputStream oos=new ObjectOutputStream(s.getOutputStream());
oos.flush();
msg+="\n";
oos.writeObject(byte2hex(msg.getBytes()));//转码处理
oos.flush();
ObjectInputStream ios = new ObjectInputStream(s.getInputStream());
//此处报错了,s.getInputStream()得到的好像是null
String inMsg=(String)ios.readObject();
System.out.println(new String(hex2byte(inMsg)));//解码处理
//jt.append(inMsg+"\n");
oos.close();
请高手看看这是什么问题