Home > Back-end >  Questions about the thread
Questions about the thread

Time:03-31

While (true) {
Try {
The Socket Socket=serverSocket. The accept ();
SocketArrayList. Add (socket);
System. Out.println (" client "+ socket. GetInetAddress () getHostAddress () +" connection success!" );
//for join in the cycle of the client to open a thread


ServerSend ServerSend=new ServerSend (socket, socketArrayList);
Thread the Thread=new Thread (serverSend);
ServerGet ServerGet=new ServerGet (socket, socketArrayList);
Thread thread2=new Thread (serverGet);



thread2.start();
Thread. The start ();

} the catch (IOException e) {
e.printStackTrace();
}

After the while loop, please open a new thread, the thread before still exist?
  • Related