title: Multi-client UDP server python
body: <p>I would like to implement an UDP server with Python.</p>
  
  <p>I want to be able to wait for some clients to connect and chat with others at the same time.</p>
  
  <p>I tried to use an SocketServer implementation</p>
  
  <pre><code>import SocketServer
  
  class MyUDPHandler(SocketServer.BaseRequestHandler):
  
      def handle(self):
          data = self.request[0].strip()
          socket = self.request[1]
          print("{} wrote:".format(self.client_address))
          print("data -&gt; ", data)
  
          socket.sendto(data.upper(), self.client_address)
  
  if __name__ == "__main__":
      HOST, PORT = "localhost", 9999
      server = SocketServer.UDPServer((HOST, PORT), MyUDPHandler)
      server.serve_forever()
  </code></pre>
  
  <p>With this implementation, I can send data from different clients to this server.</p>
  
  <p>To be clear, what I want to do is to go in another function when a client sent UDP data to the server to be able to communicate with him. But at the same time, I still want other clients be able to send UDP data. I guess multithreading will be a solution ?</p>
  
  <p>I'm not sure to be clear...</p>