Non-blocking UDP I/O vs blocking UDP I/O in Java

后端 未结 3 2024
一整个雨季
一整个雨季 2021-02-04 04:39

Non-blocking TCP/IP SocketChannels and Selector in NIO help me to handle many TCP/IP connections with small number of threads. But how about UDP

3条回答
  •  天涯浪人
    2021-02-04 04:58

    Non blocking UDP is mostly useful on the receiving side. Packet sending can only be delayed due to local circumstances: local traffic shaping tools like "gaming network cards" that prioritize gaming traffic over other traffic sources, or overloaded network card (which is not likely to happen) can delay the sending of a packet. Once out of the system. Once the packet leaves the local interface, it's no longer the application's concern.

提交回复
热议问题