Johan,
I would call Dispose on the UdpClient. This will dispose of the client,
and probably shut down the socket.
You will have to prepare for this in your thread, as the Receive method
will probably throw.
Why are you blocking on Receive? Why not call BeginReceive and pass a
callback to it to be informed when it returns? This way, you don't have to
block a thread. It would be much more efficient.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Sagaert Johan" <RE*************@hotmail.com> wrote in message
news:eG**************@TK2MSFTNGP02.phx.gbl...
The backgroundworker contains a blocking call to UDPClient.Receive
How do i unlock this thread so the backgroundworker can be cancelled ?
Johan