hello,
i am getting an excepetion when i try to read an object from an ObjectInputStream via network like this:
Socket socket = new Socket("localhost", 4444);
ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
while ((Object o = ois.readObject()) != null) {
}
Here is the exception I get:
java.io.EOFException at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source)
The connection itself seems fine, since i am able to read strings via the network, but objects dont work.
Since it is an EOFExcepetion i assume that the stream currently sends no more data. (which is ok after the first object being sent). so i was thinking maybe i am using objectdeserialization the wrong way?
what could be the problem here? thanks!