public SubscriptionSession(
        CancellationTokenSource session,
        ISocketSessionInterceptor sessionInterceptor,
        ISocketConnection connection,
        IResponseStream responseStream,
        ISubscription subscription,
        IExecutionDiagnosticEvents diagnosticEvents,
        string clientSubscriptionId)
    {
        _session = session ??
                   throw new ArgumentNullException(nameof(session));
        _sessionInterceptor = sessionInterceptor ??
                              throw new ArgumentNullException(nameof(sessionInterceptor));
        _connection = connection ??
                      throw new ArgumentNullException(nameof(connection));
        _responseStream = responseStream ??
                          throw new ArgumentNullException(nameof(responseStream));
        _diagnosticEvents = diagnosticEvents ??
                            throw new ArgumentNullException(nameof(diagnosticEvents));
        Subscription = subscription ??
                       throw new ArgumentNullException(nameof(subscription));
        Id = clientSubscriptionId ??
             throw new ArgumentNullException(nameof(clientSubscriptionId));

        _sessionToken = _session.Token;

        Task.Factory.StartNew(
            SendResultsAsync,
            _sessionToken,
            TaskCreationOptions.LongRunning,
            TaskScheduler.Default);
    }
示例#2
0
 public DataStartMessageHandler(
     IRequestExecutor requestExecutor,
     ISocketSessionInterceptor socketSessionInterceptor)
 {
     _requestExecutor = requestExecutor ??
                        throw new ArgumentNullException(nameof(requestExecutor));
     _socketSessionInterceptor = socketSessionInterceptor ??
                                 throw new ArgumentNullException(nameof(socketSessionInterceptor));
 }
示例#3
0
 public DataStartMessageHandler(
     IRequestExecutor requestExecutor,
     ISocketSessionInterceptor socketSessionInterceptor,
     IErrorHandler errorHandler,
     IExecutionDiagnosticEvents diagnosticEvents)
 {
     _requestExecutor = requestExecutor ??
                        throw new ArgumentNullException(nameof(requestExecutor));
     _socketSessionInterceptor = socketSessionInterceptor ??
                                 throw new ArgumentNullException(nameof(socketSessionInterceptor));
     _errorHandler = errorHandler ??
                     throw new ArgumentNullException(nameof(errorHandler));
     _diagnosticEvents = diagnosticEvents ??
                         throw new ArgumentNullException(nameof(diagnosticEvents));
 }
 public TerminateConnectionMessageHandler(ISocketSessionInterceptor socketSessionInterceptor)
 {
     _socketSessionInterceptor = socketSessionInterceptor ??
                                 throw new ArgumentNullException(nameof(socketSessionInterceptor));
 }
 public InitializeConnectionMessageHandler(
     ISocketSessionInterceptor socketSessionInterceptor)
 {
     _socketSessionInterceptor = socketSessionInterceptor;
 }