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); }
public ConnectionAcceptor(IConnectionListener listener, int maxAccepts, int maxPendingConnections, ConnectionAvailableCallback callback, ErrorCallback errorCallback) { if (maxAccepts <= 0) { throw Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maxAccepts", (object)maxAccepts, Microsoft.ServiceBus.SR.GetString(Resources.ValueMustBePositive, new object[0]))); } Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.DebugAssert(maxPendingConnections > 0, "maxPendingConnections must be positive"); this.listener = listener; this.maxAccepts = maxAccepts; this.maxPendingConnections = maxPendingConnections; this.callback = callback; this.errorCallback = errorCallback; this.onConnectionDequeued = new Action(this.OnConnectionDequeued); this.acceptCompletedCallback = Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ThunkAsyncCallback(new AsyncCallback(this.AcceptCompletedCallback)); this.scheduleAcceptCallback = new Action <object>(this.ScheduleAcceptCallback); }
public ConnectionAcceptor(IConnectionListener listener, int maxAccepts, int maxPendingConnections, ConnectionAvailableCallback callback, ErrorCallback errorCallback) { if (maxAccepts <= 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maxAccepts", maxAccepts, SR.Format(SR.ValueMustBePositive))); } Fx.Assert(maxPendingConnections > 0, "maxPendingConnections must be positive"); this.listener = listener; this.maxAccepts = maxAccepts; this.maxPendingConnections = maxPendingConnections; this.callback = callback; this.errorCallback = errorCallback; onConnectionDequeued = new Action(OnConnectionDequeued); handleCompletedAcceptAsync = Fx.ThunkCallback <Task <IConnection> >(HandleCompletedAcceptAsync); }
public ConnectionAcceptor(IConnectionListener listener, int maxAccepts, int maxPendingConnections, ConnectionAvailableCallback callback, ErrorCallback errorCallback) { if (maxAccepts <= 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maxAccepts", maxAccepts, SR.GetString(SR.ValueMustBePositive))); } Fx.Assert(maxPendingConnections > 0, "maxPendingConnections must be positive"); this.listener = listener; this.maxAccepts = maxAccepts; this.maxPendingConnections = maxPendingConnections; this.callback = callback; this.errorCallback = errorCallback; this.onConnectionDequeued = new Action(OnConnectionDequeued); this.acceptCompletedCallback = Fx.ThunkCallback(new AsyncCallback(AcceptCompletedCallback)); this.scheduleAcceptCallback = new Action<object>(ScheduleAcceptCallback); }
public ConnectionAcceptor(IConnectionListener listener, int maxAccepts, int maxPendingConnections, ConnectionAvailableCallback callback, ErrorCallback errorCallback) { if (maxAccepts <= 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maxAccepts", maxAccepts, SR.GetString(SR.ValueMustBePositive))); } Fx.Assert(maxPendingConnections > 0, "maxPendingConnections must be positive"); this.listener = listener; this.maxAccepts = maxAccepts; this.maxPendingConnections = maxPendingConnections; this.callback = callback; this.errorCallback = errorCallback; this.onConnectionDequeued = new Action(OnConnectionDequeued); this.acceptCompletedCallback = Fx.ThunkCallback(new AsyncCallback(AcceptCompletedCallback)); this.scheduleAcceptCallback = new Action <object>(ScheduleAcceptCallback); }
public ConnectionAcceptor(IConnectionListener listener, int maxAccepts, int maxPendingConnections, ConnectionAvailableCallback callback) : this(listener, maxAccepts, maxPendingConnections, callback, null) { // empty }