我在网上看到了这段代码.但是,我无法理解while(true)在此代码中阻塞是如何发生的:
private void ListenForClients()
{
this.tcpListener.Start();
while (true)
{
//blocks until a client has connected to the server
TcpClient client = this.tcpListener.AcceptTcpClient();
//create a thread to handle communication
//with connected client
Thread clientThread = new Thread(new ParameterizedThreadStart(HandleClientComm));
clientThread.Start(client);
}
}
Run Code Online (Sandbox Code Playgroud)
有谁可以向我解释一下?我知道使用while(true)+破坏条件,但这件事超出了我的意思.