Server端:
ServerSocket socket = new ServerSocket(9999, 10); //9999为端口号,10为最大连接数;
client = socket.accept();
Client端:
client = new Socket(localhost, 9999);//localhost表示ip地址为本地,可换成其他Ip地址;
Server端:
ServerSocket socket = new ServerSocket(9999, 10); //9999为端口号,10为最大连接数;
client = socket.accept();
Client端:
client = new Socket(localhost, 9999);//localhost表示ip地址为本地,可换成其他Ip地址;