Ema*_*uel 1 c# connection multithreading tcp tcplistener
我已经创建了一个客户端 - 服务器应用程序,并且在服务器上我希望有机会停止服务器然后再次启动它.问题是我无法阻止侦听Tcp连接的线程.
如何在C#中关闭线程?
谢谢.
private void KeepServer(){
while (this.connected)
{
tcpClient = tls.AcceptTcpClient();
Connection newConnection = new Connection(tcpClient);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7134 次 |
| 最近记录: |