I dont know why but suddenly i am facing problems in sending and receiving a List over a TCP socket, initially I was successful in doing so. Here is my transfer code:
Sender:
List<String> A = ....;
ObjectOutputStream out = new ObjectOutputStream(soc.getOutputStream());
System.out.println("Wrinting the answers");
out.writeObject(A);
System.out.println("Wrote the answers, now reading the flag");
I am getting the SOP correctly, however the reciever goes into waiting state:
ObjectInputStream in = new ObjectInputStream(soc.getInputStream());
ls = (List<String>)in.readObject();
System.out.println("Recieved the list of results");
Here I am not getting the SOP and the receiver continues to be in waiting state.
To add: I was successful in transfering the List previously, but then I made a few changes here and there and now dont know what is the problem. I actually intend to transfer another List<> too, but I will try that only when I get the solution to the first problem! Thanks for your answer..
Try this: