public ServerTestHelper(UnitTestBase owner, MessageReader reader, MessageWriter writer,
                         StreamRpcServerHandlerOptions options)
 {
     ServiceHost         = Utility.CreateJsonRpcServiceHost(owner);
     ServerHandler       = new StreamRpcServerHandler(ServiceHost, options);
     ServerMessageReader = reader;
     ServerMessageWriter = writer;
     disposables.Add(ServerHandler.Attach(ServerMessageReader, ServerMessageWriter));
 }
 public StreamRpcServerHandler(IJsonRpcServiceHost serviceHost,
                               StreamRpcServerHandlerOptions options) : base(serviceHost)
 {
     Options = options;
     if ((options & StreamRpcServerHandlerOptions.SupportsRequestCancellation) ==
         StreamRpcServerHandlerOptions.SupportsRequestCancellation)
     {
         requestCtsDict             = new ConcurrentDictionary <MessageId, CancellationTokenSource>();
         requestCancellationFeature = new RequestCancellationFeature(this);
     }
     else
     {
         requestCtsDict             = null;
         requestCancellationFeature = null;
     }
     preserveResponseOrder = (options & StreamRpcServerHandlerOptions.ConsistentResponseSequence) ==
                             StreamRpcServerHandlerOptions.ConsistentResponseSequence;
 }