private void AsyncCompleted(object sender, SocketAsyncEventArgs e) { EventWaitHandle handle = (EventWaitHandle)e.UserToken; _log.WriteLine( "AsyncCompleted: " + e.GetHashCode() + " SocketAsyncEventArgs with manual event " + handle.GetHashCode() + " error: " + e.SocketError); handle.Set(); }
private void Connected(object sender, SocketAsyncEventArgs e) { EventWaitHandle handle = (EventWaitHandle)e.UserToken; _output.WriteLine( "Connected: " + e.GetHashCode() + " SocketAsyncEventArgs with manual event " + handle.GetHashCode() + " error: " + e.SocketError); Error = e.SocketError; handle.Set(); }
private void Connected(object sender, SocketAsyncEventArgs e) { EventWaitHandle handle = (EventWaitHandle)e.UserToken; _output.WriteLine( "Connected: " + e.GetHashCode() + " SocketAsyncEventArgs with manual event " + handle.GetHashCode() + " error: " + e.SocketError); Error = e.SocketError; if (Error != SocketError.Success) { Thread.Sleep(TestSettings.FailingTestTimeout); // Give the other end a chance to call Accept(). _serverSocket.Dispose(); // Cancels the test } handle.Set(); }