(For future readers :) I had the same problem, because I made stupid changes in the server program and did not test it for a long time, then I was confused why the program was blocked.
ServerSocket
accepts the connection ( responderSocket = serverSock.accept();
), and then unexpectedly for the unattractive if
program (the stupid changes I mentioned!) Jumps out of the stream, and because I did not add a finally
block to close the streams and sockets , the socket was left without access or without any messages (even stream headers). Thus, in the client program there was no thread header (When I debbugged. In the code, I saw that the last function executed before the lock was:
public ObjectInputStream(InputStream in) throws IOException { verifySubclass(); bin = new BlockDataInputStream(in); handles = new HandleTable(10); vlist = new ValidationList(); enableOverride = false; readStreamHeader();
readStreamHeader();
)
Therefore, be careful what is happening on the server side, maybe the problem is not where you expect it!
source share