![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
网络通讯
魔力小猪
一分耕耘,一分收获
展开
-
Netty使用
Netty使用Java序列化案例import com.mayikt.days01.server.serialize.UserInfo;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.ObjectInputStream;import java.io.Obje原创 2021-02-14 19:51:18 · 216 阅读 · 2 评论 -
三种IO模型
三种IO模型BIO简单代码实现服务器端public class SocketBioServer { public static void main(String[] args) throws IOException { ServerSocket serverSocket = new ServerSocket(9001); while (true) { System.out.println("服务器端正在等待连接中...");原创 2021-02-11 23:31:50 · 178 阅读 · 0 评论 -
Socket网络通讯协议之(TCP/UDP)
Socket网络通讯协议之(TCP/UDP)TCP通讯代码TCP服务器端public class SocketTcpServer { public static void main(String[] args) throws IOException { // 创建Server Socket ServerSocket serverSocket = new ServerSocket(); // 创建我们的 Socket 监听连接地址和端口号原创 2021-02-10 16:28:47 · 281 阅读 · 1 评论