I want to send a vector<string> from client to server through socket.
It gave me the following error:
"java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFull y(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.rea dShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at testing.testing1.run(testing1.java:337)"

when I tried the following code:

Client side:

Socket socket = null;
DataOutputStream dout;
ObjectOutputStream oos;


try
{
for (int i=0; i<list.size(); i++)
{
socket = new Socket(list.elementAt(i),PORT);
PrintWriter outStart = new PrintWriter(socket.getOutputStream(), true);
outStart.println(START);
outStart.flush();


//transmit vector<string>
dout = new DataOutputStream (socket.getOutputStream());
oos = new ObjectOutputStream (dout);
oos.writeObject(list);
oos.flush();


PrintWriter outInitialize = new PrintWriter(socket.getOutputStream(), true);
outInitialize.println(INITIALIZED);
outInitialize.flush();
socket.close();
}

}
catch (IOException e)
{
e.printStackTrace();
}

Server side:

Socket socket;
ServerSocket serverSocket;
DataInputStream din;
ObjectInputStream ois;

try
{
serverSocket = new ServerSocket(PORT);
socket = serverSocket.accept();

din = new DataInputStream(socket.getInputStream());
ois = new ObjectInputStream (din);


@SuppressWarnings("unchecked")
Vector<String> list = (Vector<String>)ois.readObject();
socket.close();
}
catch (IOException e)
{
e.printStackTrace();


}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}

Could any give a help?