public void Start(ProcessRequestCallback processRequestCallback, ConnectionClosedCallback connectionClosedCallback) { _processRequestCallback = processRequestCallback; _connectionClosedCallback = connectionClosedCallback; _receiveLoopTask = ReceiveLoopAsync(_receiveLoopCancellationTokenSource.Token); var _ = _receiveLoopTask.ContinueWith(t => ReceiveLoopFaulted(t.Exception), default,
public ListenerSingletonConnectionReader(IConnection connection, Action connectionDequeuedCallback, TransportType transportType, long streamPosition, int offset, int size, ConnectionClosedCallback closedCallback, ViaDecodedCallback viaDecodedCallback) : base(connection, connectionDequeuedCallback, transportType, offset, size, closedCallback, viaDecodedCallback) { this.decoder = new ServerSingletonDecoder(streamPosition, ListenerConstants.MaxUriSize, ListenerConstants.SharedMaxContentTypeSize); }
public ListenerSessionConnectionReader(IConnection connection, Action connectionDequeuedCallback, TransportType transportType, long streamPosition, int offset, int size, ConnectionClosedCallback closedCallback, ViaDecodedCallback viaDecodedCallback) : base(connection, connectionDequeuedCallback, transportType, offset, size, closedCallback, viaDecodedCallback) { this.decoder = new ServerSessionDecoder(streamPosition, ListenerConstants.MaxUriSize, ListenerConstants.SharedMaxContentTypeSize); }
public ServerSingletonPreambleConnectionReader(IConnection connection, Action connectionDequeuedCallback, long streamPosition, int offset, int size, TransportSettingsCallback transportSettingsCallback, ConnectionClosedCallback closedCallback, ServerSingletonPreambleCallback callback) : base(connection, closedCallback) { this.decoder = new ServerSingletonDecoder(streamPosition, base.MaxViaSize, base.MaxContentTypeSize); this.offset = offset; this.size = size; this.callback = callback; this.transportSettingsCallback = transportSettingsCallback; this.rawConnection = connection; base.ConnectionDequeuedCallback = connectionDequeuedCallback; }
protected DupHandleConnectionReader(IConnection connection, Action connectionDequeuedCallback, TransportType transportType, int offset, int size, ConnectionClosedCallback closedCallback, ViaDecodedCallback viaDecodedCallback) : base(connection, closedCallback, ListenerConstants.MaxUriSize, ListenerConstants.SharedMaxContentTypeSize) { this.transportType = transportType; this.offset = offset; this.size = size; this.viaDecodedCallback = viaDecodedCallback; this.ConnectionDequeuedCallback = connectionDequeuedCallback; }
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; }
public ServerSingletonPreambleConnectionReader(IConnection connection, Action connectionDequeuedCallback, long streamPosition, int offset, int size, TransportSettingsCallback transportSettingsCallback, ConnectionClosedCallback closedCallback, ServerSingletonPreambleCallback callback) : base(connection, closedCallback) { decoder = new ServerSingletonDecoder(streamPosition, MaxViaSize, MaxContentTypeSize); this.offset = offset; this.size = size; this.callback = callback; this.transportSettingsCallback = transportSettingsCallback; rawConnection = connection; ConnectionDequeuedCallback = connectionDequeuedCallback; }
public ListenerConnectionDemuxer(IConnectionListener listener, TransportType transportType, int maxAccepts, int initialMaxPendingConnections, TimeSpan channelInitializationTimeout, ConnectionHandleDuplicated connectionHandleDuplicated) { this.transportType = transportType; this.connectionReaders = new List <InitialServerConnectionReader>(); this.connectionHandleDuplicated = connectionHandleDuplicated; this.acceptor = new ConnectionAcceptor(listener, maxAccepts, initialMaxPendingConnections, OnConnectionAvailable); this.channelInitializationTimeout = channelInitializationTimeout; this.onConnectionClosed = new ConnectionClosedCallback(OnConnectionClosed); this.onViaDecoded = new ViaDecodedCallback(OnViaDecoded); }
public async Task StartAsync(RequestMessage startMessage, ProcessReplyCallback processReplyCallback, ConnectionClosedCallback connectionClosedCallback) { Guard.Against.Null(processReplyCallback, nameof(processReplyCallback)); Guard.Against.Null(connectionClosedCallback, nameof(connectionClosedCallback)); _processReplyCallback = processReplyCallback; _connectionClosedCallback = connectionClosedCallback; try { await SendMessageAsync(startMessage, false); _receiveLoopTask = ReceiveLoopAsync(_receiveLoopCancellationTokenSource.Token); var _ = _receiveLoopTask.ContinueWith(t => ReceiveLoopFaulted(t.Exception), default,
public ListenerConnectionDemuxer(IConnectionListener listener, TransportType transportType, int maxAccepts, int initialMaxPendingConnections, TimeSpan channelInitializationTimeout, ConnectionHandleDuplicated connectionHandleDuplicated) { this.transportType = transportType; this.connectionReaders = new List<InitialServerConnectionReader>(); this.connectionHandleDuplicated = connectionHandleDuplicated; this.acceptor = new ConnectionAcceptor(listener, maxAccepts, initialMaxPendingConnections, OnConnectionAvailable); this.channelInitializationTimeout = channelInitializationTimeout; this.onConnectionClosed = new ConnectionClosedCallback(OnConnectionClosed); this.onViaDecoded = new ViaDecodedCallback(OnViaDecoded); }
protected InitialServerConnectionReader(IConnection connection, ConnectionClosedCallback closedCallback, int maxViaSize, int maxContentTypeSize) { if (connection == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("connection"); } if (closedCallback == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("closedCallback"); } this.connection = connection; this.closedCallback = closedCallback; this.maxContentTypeSize = maxContentTypeSize; this.maxViaSize = maxViaSize; }
public ConnectionDemuxer(IConnectionListener listener, int maxAccepts, int maxPendingConnections, TimeSpan channelInitializationTimeout, TimeSpan idleTimeout, int maxPooledConnections, TransportSettingsCallback transportSettingsCallback, SingletonPreambleDemuxCallback singletonPreambleCallback, ServerSessionPreambleDemuxCallback serverSessionPreambleCallback, ErrorCallback errorCallback) { connectionReaders = new List <InitialServerConnectionReader>(); acceptor = new ConnectionAcceptor(listener, maxAccepts, maxPendingConnections, OnConnectionAvailable, errorCallback); this.channelInitializationTimeout = channelInitializationTimeout; this.idleTimeout = idleTimeout; this.maxPooledConnections = maxPooledConnections; onConnectionClosed = new ConnectionClosedCallback(OnConnectionClosed); this.transportSettingsCallback = transportSettingsCallback; this.singletonPreambleCallback = singletonPreambleCallback; this.serverSessionPreambleCallback = serverSessionPreambleCallback; }
protected InitialServerConnectionReader(IConnection connection, ConnectionClosedCallback closedCallback) : this(connection, closedCallback, 0x800, 0x100) { }
protected InitialServerConnectionReader(IConnection connection, ConnectionClosedCallback closedCallback) : this(connection, closedCallback, ConnectionOrientedTransportDefaults.MaxViaSize, ConnectionOrientedTransportDefaults.MaxContentTypeSize) { }
public ListenerConnectionModeReader(IConnection connection, ListenerConnectionModeCallback callback, ConnectionClosedCallback closedCallback) : base(connection, closedCallback) { this.callback = callback; }
public void OnConnectionClosed(object sender, object args) { Console.WriteLine("Connection was closed!"); ConnectionClosedCallback?.Invoke(); }