title: SocketServer "accept()" method does not work?
body: <p>im just testing a bit with Sockets and ServerSockets. So I did a little Test program, but it doesnt work. It seems like it stops somewhere in the ".accept()" method, but I dont know why. Could anyone help?</p>
  
  <pre><code>public class ServerToClient
  {
  
      public static void main(String[] args) throws IOException
      {
          ServerSocket server = new ServerSocket(1235);
          server.setSoTimeout(10000);
          try
          {
  
              Socket client = server.accept();
              client.close();
              server.close();
              System.out.println("Client: " + client.isClosed());
              System.out.println("Server: " + server.isClosed());
          }
          catch(InterruptedIOException e)
          {
              System.err.println("Timeout");
              server.close();
          }
  
  
      }
  
  }
  </code></pre>