S
Stefan Weber
Hi
I do something like that on one network node (site1):
socket = new Socket(...);
oos = new ObjectOutputStream(socket.getOutputStream());
oos.writeObject(new Object());
socket.close();
On another node (lets call it site2) I frequently call
ois.readObject();
where ois is the ObjectInputStream on the same connection. I have set a
timeout for the socket at site 2. The idea is that I can do some other
work until the object actually arrived.
But unfortunately, this seems to raise problems when the socket on site
1 is closed before the object is read on site 2. In such cases, an
EOFException is thrown.
I'm not a 100% sure if this is really the reason, because it hardly
makes sense to me, because even though site1 closed the connection, the
data was sent to site2 and thus is available in the buffer...
Or does the exception arise due to another reason?
Thanks a lot! Regards,
Stefan Weber
I do something like that on one network node (site1):
socket = new Socket(...);
oos = new ObjectOutputStream(socket.getOutputStream());
oos.writeObject(new Object());
socket.close();
On another node (lets call it site2) I frequently call
ois.readObject();
where ois is the ObjectInputStream on the same connection. I have set a
timeout for the socket at site 2. The idea is that I can do some other
work until the object actually arrived.
But unfortunately, this seems to raise problems when the socket on site
1 is closed before the object is read on site 2. In such cases, an
EOFException is thrown.
I'm not a 100% sure if this is really the reason, because it hardly
makes sense to me, because even though site1 closed the connection, the
data was sent to site2 and thus is available in the buffer...
Or does the exception arise due to another reason?
Thanks a lot! Regards,
Stefan Weber