title: Server/client UDP, sender uses a random port
body: <p>I am trying to do a simple client/server chat example using <code>UDP</code> sockets. </p>
  
  <p>The idea is to have 2 applications running on 2 different PCs. Each program is both client and server. </p>
  
  <p>The server is bind on <code>0.0.0.0</code> port <code>9999</code> and the client is using as well the port <code>9999</code>. </p>
  
  <pre><code>client_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
  other_address.sin_family = AF_INET;
  other_address.sin_port = htons(9999);
  other_address.sin_addr.s_addr = inet_addr(192.168.1.42); 
  sendto(client_socket, data, size,
      0, other_address, sizeof(struct sockaddr_in));
  </code></pre>
  
  <p>On Wireshark I can see the origin port is random chosen from 53783 to 57229. </p>
  
  <pre><code>Source       Destination  Protocol  Info
  192.168.1.6  192.168.1.42  UDP      57229 -&gt; 9999
  192.168.1.42 192.168.1.6   UDP      53783 -&gt; 9999
  </code></pre>
  
  <p>What is my mistake?</p>