socket服务端处理多个客户端的请求:
while(true){
Socket s=ss.accept();
new WorkThread(s).start();
}
class WorkThread edtends Thread{
private Socket s;
public WorkThread(Socket s){
this.s=s;
}
public void run(){
s.getInput();
s.getOutput();
}
}
时间: 2024-10-22 09:55:18