Proper way to stop TcpListener
These are two quick fixes you can use, given the code and what I presume is your design: 1. Thread.Abort() If you have started this TcpListener thread from another, you can simply call Abort() on the thread, which will cause a ThreadAbortException within the blocking call and walk up the stack. 2. TcpListener.Pending() The second … Read more