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?
VulpesPosted Jul 24, 2013, 7:47 AM
Check the documentation on this method for full details:
http://msdn.microsoft.com/en-us/library/ty8d3wta.aspx
Iftikar HussainPosted Jul 24, 2013, 7:35 AM
Try like this
com.t.Abort();
// Wait for the thread to terminate.
Regards,
Iftikar