internal static void SendFault(IConnection connection, string fault) { if (drainBuffer == null) { lock (ThisStaticLock) { if (drainBuffer == null) { drainBuffer = new byte[1024]; } } } try { InitialServerConnectionReader.SendFault(connection, fault, drainBuffer, ListenerConstants.SharedSendTimeout, ListenerConstants.SharedMaxDrainSize); } catch (Exception exception) { if (Fx.IsFatal(exception)) { throw; } // We don't care the error when sending a fault. DiagnosticUtility.TraceHandledException(exception, TraceEventType.Warning); } }
void OnConnectionClosed(InitialServerConnectionReader connectionReader) { lock (ThisLock) { if (isDisposed) { return; } connectionReaders.Remove(connectionReader); } }
void OnViaDecoded(InitialServerConnectionReader connectionReader, ListenerSessionConnection session) { try { connectionHandleDuplicated(session); } finally { session.TriggerDequeuedCallback(); } lock (ThisLock) { if (isDisposed) { return; } connectionReaders.Remove(connectionReader); } }