建一个服务端类ChatServer,用于设置端口接收连接 package com.swift; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; public class ChatServer { public static void main(String[] args) { try { ServerSocket ss = new ServerSocket(8888); for (…