private PayloadSizeEstimator payloadEstimator; // Used to estimate the buffer required to serialize // the next message sent /// <summary> /// Constructor. /// </summary> /// <param name="channelManager">The responsible channel manager.</param> /// <param name="remoteAddress">The remote <see cref="EndpointAddress" />.</param> /// <param name="via">The first transport hop <see cref="Uri" />.</param> /// <param name="encoder">The <see cref="MessageEncoder" /> for serializing messages to the wire format.</param> public OutputChannel(ChannelManagerBase channelManager, EndpointAddress remoteAddress, Uri via, MessageEncoder encoder) : base(channelManager) { ServiceModelHelper.ValidateEP(remoteAddress.Uri); ServiceModelHelper.ValidateEP(via); this.remoteAddress = remoteAddress; this.via = via; this.encoder = encoder; this.ep = ServiceModelHelper.ToMsgEP(remoteAddress.Uri); this.payloadEstimator = new PayloadSizeEstimator(ServiceModelHelper.PayloadEstimatorSampleCount); }
private PayloadSizeEstimator payloadEstimator; // Used to estimate the buffer required to serialize // the next message sent /// <summary> /// Constructor. /// </summary> /// <param name="channelManager">The responsible channel manager.</param> /// <param name="localAddress">The local <see cref="EndpointAddress" /> this channel will use to receive requests.</param> /// <param name="encoder">The <see cref="MessageEncoder" /> for serializing messages to the wire format.</param> public ReplyChannel(ChannelManagerBase channelManager, EndpointAddress localAddress, MessageEncoder encoder) : base(channelManager) { this.maxReceiveQueueSize = ServiceModelHelper.MaxAcceptedMessages; // $todo(jeff.lill): Hardcoding this this.listener = (ReplyChannelListener)channelManager; this.localAddress = localAddress; this.requestQueue = new LimitedQueue <RequestInfo>(maxReceiveQueueSize); this.pendingRequests = new Dictionary <Guid, MsgRequestContext>(); this.encoder = encoder; this.payloadEstimator = new PayloadSizeEstimator(ServiceModelHelper.PayloadEstimatorSampleCount); }
private DuplexSession session; // Underlying LillTek Messaging session /// <summary> /// Constructor. /// </summary> /// <param name="channelManager">The responsible channel manager.</param> /// <param name="remoteAddress">The remote <see cref="EndpointAddress" />.</param> /// <param name="via">The first transport hop <see cref="Uri" />.</param> /// <param name="encoder">The <see cref="MessageEncoder" /> for serializing messages to the wire format.</param> public OutputSessionChannel(ChannelManagerBase channelManager, EndpointAddress remoteAddress, Uri via, MessageEncoder encoder) : base(channelManager) { ServiceModelHelper.ValidateEP(remoteAddress.Uri); ServiceModelHelper.ValidateEP(via); this.ep = ServiceModelHelper.ToMsgEP(remoteAddress.Uri); if (ep.Broadcast) { throw new ArgumentException("Sessionful channels cannot accept broadcast endpoints.", "remoteAddress"); } this.remoteAddress = remoteAddress; this.via = via; this.encoder = encoder; this.payloadEstimator = new PayloadSizeEstimator(ServiceModelHelper.PayloadEstimatorSampleCount); this.session = ChannelHost.Router.CreateDuplexSession(); }