void OnConnectionAvailable(IConnection connection, Action connectionDequeuedCallback)
        {
            if (transportType == TransportType.Tcp)
            {
                ListenerPerfCounters.IncrementConnectionsAcceptedTcp();
            }
            else
            {
                ListenerPerfCounters.IncrementConnectionsAcceptedNamedPipe();
            }

            ListenerConnectionModeReader modeReader = SetupModeReader(connection);

            if (modeReader != null)
            {
                // StartReading() will never throw non-fatal exceptions;
                // it propagates all exceptions into the onConnectionModeKnown callback,
                // which is where we need our robust handling
                modeReader.StartReading(this.channelInitializationTimeout, connectionDequeuedCallback);
            }
            else
            {
                connectionDequeuedCallback();
            }
        }
Beispiel #2
0
 void IncrementUrisRegisteredCounters()
 {
     if (this.TransportType == TransportType.Tcp)
     {
         ListenerPerfCounters.IncrementUrisRegisteredTcp();
     }
     else
     {
         ListenerPerfCounters.IncrementUrisRegisteredNamedPipe();
     }
 }
Beispiel #3
0
 protected void DecrementRegistrationsActiveCounters()
 {
     if (this.TransportType == TransportType.Tcp)
     {
         ListenerPerfCounters.DecrementRegistrationsActiveTcp();
     }
     else
     {
         ListenerPerfCounters.DecrementRegistrationsActiveNamedPipe();
     }
 }
Beispiel #4
0
 internal static void OnDispatchFailure(TransportType transportType)
 {
     if (transportType == TransportType.Tcp)
     {
         ListenerPerfCounters.IncrementDispatchFailuresTcp();
     }
     else if (transportType == TransportType.NamedPipe)
     {
         ListenerPerfCounters.IncrementDispatchFailuresNamedPipe();
     }
 }
        void AbortAndCount(Exception exception)
        {
            if (transportType == TransportType.Tcp)
            {
                ListenerPerfCounters.IncrementProtocolFailuresTcp();
            }
            else if (transportType == TransportType.NamedPipe)
            {
                ListenerPerfCounters.IncrementProtocolFailuresNamedPipe();
            }

            base.Abort(exception);
        }
 protected override void OnDispatchSuccess()
 {
     ListenerPerfCounters.IncrementConnectionsDispatchedTcp();
 }