![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java-Network
DavidDing2088
这个作者很懒,什么都没留下…
展开
-
Java NIO之TCP
流( TCP )信道详解 流信道有两个变体: SocketChannel 和 ServerSocketChannel 。像其对应的 Socket 一样,SocketChannel 是相互连接的终端进行通信的信道。 l SocketChannel :创建,连接和关闭 static SocketChannel open(SocketAddress remote) static转载 2016-02-20 11:47:14 · 843 阅读 · 0 评论 -
使用ServerSocketChannel与SocketChannel实现的CS模式
NIO Selector示意图: 客户端代码: import java.io.IOException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.Selector;转载 2016-02-16 23:38:24 · 544 阅读 · 0 评论