0
爲什麼我在tcpClient = this.ss.AcceptTcpClient
上掛起程序?爲什麼我在AcceptTcpClient上掛起程序?
public virtual void Run()
{
if (this.tcpListener == null)
return;
TcpClient tcpClient = (TcpClient)null;
while (!this.m_Stop)
{
try
{
tcpClient = this.tcpListener.AcceptTcpClient();
ThreadPool.QueueUserWorkItem(new WaitCallback(this.handler.Handle), (object)tcpClient);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
這裏ss
是TcpListener
。
好的謝謝你的信息。 – user3592352
但我怎麼能用它給任何例子先謝謝 – user3592352
試試這個:http://msdn.microsoft.com/en-us/library/vstudio/system.net.sockets.tcplistener.pending%28v=vs.100 %29 –