title: UDP Broadcasting for automatic search of servers
body: <p>I am making a multiplayer networking game. Now to connect to the server, client needs the ip address of the server.</p>
  
  <p>So, the way I implement this is as follows.</p>
  
  <p>Client Broadcasts its ip address at Broadcast IP and a port say A.
  Server listens to it over A, and</p>
  
  <p>Server creates a new UDP connection with the client behaving as a client say over port B. It sends all the important information required for the game including its IP.</p>
  
  <p>Client is the server for this connection and receives the data from server over port B.</p>
  
  <p>Now, A and B are constants. So when I need the server to listen for multiple clients in different threads I can put diff values to A and B for the threads but in the client file A and B are independent of these threads. So it gives me an error of </p>
  
  <p><code>bind: Address already in use</code></p>
  
  <p>What is the plausible solution for this?</p>