title: Handle multiple port server
body: <p>I have to write a server which have to accept clients on ports that they have specified.<br>
  Example : <code>A</code> wants to connect on port 1337, so server listen on port 1337. <code>B</code> on 1992 so server listen on 1992, etc...  </p>
  
  <p>I don't know how to handle this.
  Should I make a system like :<br>
  - All clients connects on the same port : XXXX ;<br>
  - The client's 1st packet specify the port he wants ;<br>
  - The server binds / listens / accepts on the new port ;<br>
  - The server answers the client that it's OK ;<br>
  - The client stops connecting on port XXXX and start connecting on the new port.<br>
  I don't know if this kind of system is good, but I can't figure out how else to do it.<br>
  Thank you, Florian</p>