How can I implement a threaded UDP based server in Java?

后端 未结 4 1673
无人共我
无人共我 2020-12-13 15:54

How can I implement a threaded UDP based server in Java ?

Basically what I want, is to connect multiple clients to the server, and let each client have his own threa

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 16:29

    Have you looked at the Apache Mina project? I believe even one of its examples takes you through how to setup an UDP-based server with it. If this for a real product, I would not recommend trying to come up with your own implementation from scratch. You will want to use a library to accomplish this so you are not using one thread per connection, rather a thread pool.

提交回复
热议问题