网络编程
折挺
干好一件件小事!
展开
-
Socket 和 ServerSocket 中 Connection timed out的作用
package org.example;import java.io.IOException;import java.net.InetSocketAddress;import java.net.Socket;public class client { public static void main(String[] args) throws IOException { final Socket socket = new Socket(); long t1原创 2022-04-17 20:54:58 · 2794 阅读 · 0 评论 -
Socket 和 ServerSocket 中 SoTimeout的作用
服务端,给具体某个Socket 设置socket.setSoTimeout(10000); //毫秒package org.example;import java.io.IOException;import java.net.InetSocketAddress;import java.net.ServerSocket;import java.net.Socket;public class Server { public static void main(String[] args)原创 2022-04-17 20:16:56 · 1280 阅读 · 0 评论 -
Socket ServerSocket IP和Port详解
package org.example;import java.io.IOException;import java.net.ServerSocket;public class Server { public static void main(String[] args) throws IOException { final ServerSocket serverSocket = new ServerSocket(8888); serverSocket.ac原创 2022-04-17 14:04:14 · 3153 阅读 · 0 评论