用while循环可以让多个客户端可以连接服务器
while(true){
//主线程等待客户端发起连接
Socket s = ss.accept(端口);
//每个网络连接操作由工作线程进行操作、通信
WorkThread t= new WorkThread(s);
t.start();
}
class WorkThread{
public WorkThread(Socket s){
this.s = s;
}
run(Socket s){
BufferedReader in = new BufferedReader(
new InputStreamReader(s.getInputStream()));
PrintWriter out = new PrintWriter(s.getOutputStream());
}
}