public class Test { public static void main(String[] args) throws Exception{ //1. 构造ServerSocket实例,指定服务端口. ServerSocket servSock = new ServerSocket(); servSock.bind(new InetSocketAddress("192.168.1.35", 8400)); System.out.println("socket服务端…
Server package com.witwicky.socket.basicsocket; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; public class Server { public static void main(String[] args) {…