title: Why Java ServerSocket accept() returns a socket with the same port as ServerSocket?
body: <p>In the server side, i use this code :</p>
  
  <pre><code>ServerSocket server = new ServerSocket(1234);
  Socket server_socket = server.accept();
  </code></pre>
  
  <p>I found the server is listening on port 1234.</p>
  
  <p>When one or more client sockets are connected, they are all using the same port 1234 !</p>
  
  <p>That is really confusing : </p>
  
  <p><img src="https://i.stack.imgur.com/FuuoC.jpg" alt="enter image description here"></p>
  
  <p>I remember that multi sockets can't use the same port, isn't it right ? Thanks.</p>