Abort() thread dont work.
I got the following code:
class communication
private UdpClient client;
{
public communication()
{
t = new Thread(new ThreadStart(listen));
}
public void listen()
{......}
}
and in form1 i got the code:
communication com=new commnunication();
com.t.Start(); //start thread works
.
.
.
any code
com.t.Abort(); //abort thread dont works
Why dont works abort thread?

Iftikar HussainRank #423 · 5.9K reputationPosted Jul 24, 2013, 3:35 AM EDT
Try like this
com.t.Abort();
// Wait for the thread to terminate.
Regards,
Iftikar
VulpesRank #55 · 29.2K reputationPosted Jul 24, 2013, 3:47 AM EDT
Check the documentation on this method for full details:
http://msdn.microsoft.com/en-us/library/ty8d3wta.aspx