I have a client-server application. Right now, I'm trying to
test sending messages from the client to the server and then read them from the server.
I'm using
ObjectInputStream and
ObjectOutputStream to transfer message objects between the client and server.
However, when I try to write an object from the client, it results in a
SocketException.
Server code:
Server Thread:
Client code:
The statement
out.writeObject(msg) causes a
ServerSocket exception with
Socket closed as the reason. And the server does not register receiving an object from
in.readObject().
netstat shows the connection as established, the error occurs when I try to write the object.
What am I doing wrong ?