title: Can I close the ServerSocket after accepting a client socket and establishing a connection?
body: <p>The question is general, although my simple program is in Java. It concerns TCP/IP connections.</p>
  
  <p>What I need is the server socket to close as soon as possible after establishing a client connection. I need maximum one client at a time, and I don't want anybody else to be able to connect.</p>
  
  <p>I noticed that if I close the server socket, I can still use the client socket but nobody is listening for further connections. Actually this is perfectly fine for me, but I'm not sure if there aren't some hidden dangers in that approach.</p>
  
  <p>What do you think?</p>