public ConnectionAcceptor(IConnectionListener listener, int maxAccepts, int maxPendingConnections, ConnectionAvailableCallback callback, System.ServiceModel.Channels.ErrorCallback errorCallback)
 {
     if (maxAccepts <= 0)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maxAccepts", maxAccepts, System.ServiceModel.SR.GetString("ValueMustBePositive")));
     }
     this.listener                = listener;
     this.maxAccepts              = maxAccepts;
     this.maxPendingConnections   = maxPendingConnections;
     this.callback                = callback;
     this.errorCallback           = errorCallback;
     this.onConnectionDequeued    = new Action(this.OnConnectionDequeued);
     this.acceptCompletedCallback = Fx.ThunkCallback(new AsyncCallback(this.AcceptCompletedCallback));
     this.scheduleAcceptCallback  = new Action <object>(this.ScheduleAcceptCallback);
 }
Пример #2
0
 public ConnectionDemuxer(IConnectionListener listener, int maxAccepts, int maxPendingConnections, TimeSpan channelInitializationTimeout, TimeSpan idleTimeout, int maxPooledConnections, TransportSettingsCallback transportSettingsCallback, SingletonPreambleDemuxCallback singletonPreambleCallback, ServerSessionPreambleDemuxCallback serverSessionPreambleCallback, System.ServiceModel.Channels.ErrorCallback errorCallback)
 {
     this.acceptor = new ConnectionAcceptor(listener, maxAccepts, maxPendingConnections, new ConnectionAvailableCallback(this.OnConnectionAvailable), errorCallback);
     this.channelInitializationTimeout = channelInitializationTimeout;
     this.idleTimeout                   = idleTimeout;
     this.maxPooledConnections          = maxPooledConnections;
     this.onConnectionClosed            = new ConnectionClosedCallback(this.OnConnectionClosed);
     this.transportSettingsCallback     = transportSettingsCallback;
     this.singletonPreambleCallback     = singletonPreambleCallback;
     this.serverSessionPreambleCallback = serverSessionPreambleCallback;
 }