Hi, I am trying to program a simple server/client socket connection program, the main function is to send and receive objects between them. I somehow went wrong and the connection between them keeps terminating right after establishing connection. Is there anything I can do to resolve this? This is gonnna be kinda long post.. sorry. These are the code that starts and ends the socket connection. I'm kinda desperate for this to work.. so thanks in advance. appinterface.java:
I got the same problem. And i post a topic in Java � I/O and Streams If you get a answer,please send a copy to me :email@example.com Thanks!
Joined: Nov 08, 2003
Hello, I have got a answer to solve this problem: The best way to create a dead lock is to try to read from both ends of a stream at the same time. I assume that the code for your server and your client are both attempting to get the ObjectInputStream before getting the ObjectOutputStream. Basically, all you have to do to fix this problem is put the getObjectOutputStream line BEFORE the getObjectInputStream line.. Hope this helps!