private InProcServerTransportController( InProcServerTransportManager transportManager, bool ownsTransportManager ) { this._transportManager = transportManager; this._transport = transportManager.NewSession(); this._transportManager.Response += this.OnTransportResponse; this._ownsTransportManager = ownsTransportManager; }
/// <summary> /// Initializes a new instance of the <see cref="InProcClientTransportManager"/> class. /// </summary> /// <param name="configuration"> /// The <see cref="RpcClientConfiguration"/> which contains various configuration information. /// </param> /// <param name="target"> /// The target server to be invoked. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="configuration"/> is <c>null</c>. /// Or, <paramref name="target"/> is <c>null</c>. /// </exception> public InProcClientTransportManager(RpcClientConfiguration configuration, InProcServerTransportManager target) : base(configuration) { if (target == null) { throw new ArgumentNullException("target"); } this._target = target; this._cancellationTokenSource = new CancellationTokenSource(); this.SetTransportPool(new OnTheFlyObjectPool <InProcClientTransport>(conf => new InProcClientTransport(this), new ObjectPoolConfiguration())); }
/// <summary> /// Initializes a new instance of the <see cref="InProcServerTransport"/> class. /// </summary> /// <param name="manager">The manager which will manage this instance.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="manager"/> is <c>null</c>. /// </exception> public InProcServerTransport( InProcServerTransportManager manager ) : base( manager ) { this._manager = manager; this._inboundQueue = new BlockingCollection<byte[]>(); this._pendingPackets = new ConcurrentQueue<InProcPacket>(); manager.Response += this.OnManagerResponse; this._cancellationTokenSource = new CancellationTokenSource(); this._receivingCancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource( manager.CancellationToken, this._cancellationTokenSource.Token ); }
private static InProcServerTransportController Create( InProcServerTransportManager asInProcServerTransportManager, bool ownsTransportManager ) { return new InProcServerTransportController( asInProcServerTransportManager, ownsTransportManager ); }