Hi, I create a TCP connection between client & server and I need to
send vectors via ObjectInputStreams back and forth (the client
initiates the protocol).
The connection is established successfully, the client sends its first
request and the server responds accordingly, the client receives the
response and tries to send another request (the request Vector is
created successfully) but something is wrong...
The following line (located in a loop at the server) throws an
exception: invalid header exception:
in = new ObjectInputStream(kkSocket.getInputStream());
And the server receive the firs request instead of the latest:
Request = (Vector)in.readObject();
How can I "refresh" the input stream?
The second request suppose to override the first so in.readObject();
at the server will return the second request.
I flush the output stream at both client and server after each output
sending.
Can anyone please help me out of this mess?
~Offer.