连接端口问题。
这服务端最多只能连2个客户端啊 ,为什么可以连3个啊 ,小弟初学,还请大虾指教。import *;
import *;
public class FirstServer {
public static void main(String args[]) throws Exception{
ServerSocket serversocket=new ServerSocket(8000,2);
Thread.sleep(60000);
}
}
import *;
import *;
public class FirstClient {
public static void main(String args[]) throws Exception {
Socket server0=new Socket("localhost",8000);
System.out.println("第一次连接成功");
Socket server1=new Socket("localhost",8000);
System.out.println("第二次连接成功");
Socket server2=new Socket("localhost",8000);
System.out.println("第三次连接成功");
}
}