private static void StartAccept(object state) { bool flag; SocketConnectionListener.AcceptAsyncResult result = (SocketConnectionListener.AcceptAsyncResult)state; Exception exception = null; try { flag = result.StartAccept(); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } flag = true; exception = exception2; } if (flag) { result.Complete(false, exception); } }
private static void AcceptAsyncCompleted(object sender, SocketAsyncEventArgs e) { SocketConnectionListener.AcceptAsyncResult userToken = (SocketConnectionListener.AcceptAsyncResult)e.UserToken; Exception exception = userToken.HandleAcceptAsyncCompleted(); if ((exception != null) && ShouldAcceptRecover((SocketException)exception)) { if (DiagnosticUtility.ShouldTraceWarning) { DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning); } StartAccept(userToken); } else { userToken.Complete(false, exception); } }