title: Handling multiple clients with UDP
body: <p>Imagine a UDP server:</p>
  
  <pre><code>while (true) {
      try {
          socket.receive(packet);
          // handle packet (potentially CPU-intensive)
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>What troubles me is that I only have 1 thread to handle all packets from all clients. I assume my server can't start multiple threads to receive packets on the same socket? While of course I could handle the packets in separate threads, I still only have 1 thread to receive datapackets, and no matter how little time it takes to forward a packet to another thread, it's still a window where the server won't hear incoming packets.</p>
  
  <p>So my question is: Do packets send to the server get lost if the server isn't currently blocked in <code>server.receive()</code>, or do they get queued for the next time the method is called? If they get lost, how can I handle multiple client?</p>