######java网络编程中出现阻塞
如图,为什么没有先writeObject就会阻塞,不能再进行下面的语句
Socket socket=new Socket("127.0.0.1",1111);
ObjectOutputStream out=new ObjectOutputStream(socket.getOutputStream());
ObjectInputStream in=new ObjectInputStream(socket.getInputStream());
out.writeObject(o);
Users userID=(Users)o; //传入object为user,类型转换!!
Message msg=(Message) in.readObject();
Socket socket=new Socket("127.0.0.1",1111);
ObjectOutputStream out=new ObjectOutputStream(socket.getOutputStream());
out.writeObject(o);
Users userID=(Users)o; //传入object为user,类型转换!!
ObjectInputStream in=new ObjectInputStream(socket.getInputStream());
Message msg=(Message) in.readObject();
ServerSocket server = new ServerSocket(1111);
Socket socket = server.accept();
ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
Users u = (Users) in.readObject();
Message msg = new Message();