title: Java - Strange hanging socket?
body: <p>I have a client-server application with a java server. It works pretty much perfect, except that after an extended period of time, all of a sudden, a socket keeps hanging. This socket is but one of many, the rest seem to do fine still, but once it gets to the socket, the server simply does not go past the sending line. These are the relevant pieces of the code:</p>
  
  <pre><code>Socket socket; // A normal socket
  out  = new PrintWriter(socket.getOutputStream(), true); // The outstream
  out.println(msg + "\0"); // This command is used to send stuff, msg is a String
  </code></pre>
  
  <p>No exceptions are thrown, the line application simply does not seem to get past the line: </p>
  
  <pre><code>out.println(msg + "\0");
  </code></pre>
  
  <p>I do know that the String is a good one, cause 4 or 5 other sockets before this one could send it just fine. Also note that, as far as I know, this socket could send hundreds of messages just fine before it suddenly hangs. Does anyone have a clue what kind of error I should be looking for?</p>