How do you evaluate if a Socket operation was successful or not with SocketAsyncEventArgs? Do you evaluate the SocketAsyncEventArgs you passed as parameter?
SocketasyncEventArgs saea = new SocketAsyncEventArgs();
socket.ConnectAsync(saea);
saea.Completed += (sender, args) =>
{
if(saea.SocketError != SocketError.Success)
// fail
}
Or do you evaluate the SocketAsyncEventArgs from the Completed event?
saea.Completed += (sender, args) =>
{
if(args.SocketError != SocketError.Success)
// fail
}
Or both? What does it mean if one shows success and the other not?