SocketChannel  叫套接字通道,面向流,就是通常的TCP

read,write 前必须建立连接,线程安全,任意时刻只能有一个线程进行读取和写入

DatagramChannel 叫数据报通道,面向数据报,就是通常的UDP

send,receive 前无需建立连接,read,write前必须建立连接,线程安全,任意时刻只能有一个线程进行读取和写入

 

相关文章:

  • 2022-12-23
  • 2021-05-29
  • 2021-10-17
  • 2021-06-04
  • 2021-10-09
  • 2022-12-23
  • 2021-05-15
  • 2021-11-15
猜你喜欢
  • 2021-08-12
  • 2022-12-23
  • 2021-12-21
  • 2021-11-28
  • 2021-08-05
相关资源
相似解决方案