Strange one that i don't still get, is this:
Say,
try
{
stateClient.Socket.BeginSend(messagePrefixed, 0, messagePrefixed.Length,
SocketFlags.None, ar => stateClient.Socket.EndSend(ar), stateClient);
}
catch (SocketException ex)
{
// Handle SocketException.
}
catch (ObjectDisposedException ex)
{
// Handle ObjectDisposedException.
}
I don't understand why if lambda expression returns with ObjectDisposedException is not catched!? I just going deeper into Lambda's and this i cant understand it, is that about scope of Lambda's? Range Variables? Thread issue? I know Lambda's is not multithreading by they're nature but as you can see the return comes from another thread which created by the BeginSend. Before convert the implementation into a Lambda this was ok when i had an AsyncCallBack method handling the EndSend().
Any help appreciated. Thank you in advance.