![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
努力編程
这个作者很懒,什么都没留下…
展开
-
BIO(阻塞IO模型)+Socket網絡通信
創建服務端import java.io.IOException;import java.net.ServerSocket;import java.net.Socket;public class BIOServerSocket { public static void main(String[] args) throws IOException { Server...原创 2019-03-25 11:57:06 · 348 阅读 · 0 评论 -
NIO(非阻塞IO)實現通信
import java.net.InetSocketAddress;import java.net.SocketAddress;import java.nio.ByteBuffer;import java.nio.channels.SelectionKey;import java.nio.channels.Selector;import java.nio.channels.ServerS...原创 2019-03-25 15:14:35 · 182 阅读 · 0 评论