public BinaryMessageEncoderFactory(System.ServiceModel.Channels.MessageVersion messageVersion, int maxReadPoolSize, int maxWritePoolSize, int maxSessionSize, XmlDictionaryReaderQuotas readerQuotas, BinaryVersion version) { this.messageVersion = messageVersion; this.messageEncoder = new BinaryMessageEncoder(this, false, 0); this.maxReadPoolSize = maxReadPoolSize; this.maxWritePoolSize = maxWritePoolSize; this.maxSessionSize = maxSessionSize; this.thisLock = new object(); this.onStreamedReaderClose = new OnXmlDictionaryReaderClose(this.ReturnStreamedReader); this.readerQuotas = new XmlDictionaryReaderQuotas(); if (readerQuotas != null) { readerQuotas.CopyTo(this.readerQuotas); } this.binaryVersion = version; }
public BinaryMessageEncoderFactory(System.ServiceModel.Channels.MessageVersion messageVersion, int maxReadPoolSize, int maxWritePoolSize, int maxSessionSize, XmlDictionaryReaderQuotas readerQuotas, BinaryVersion version) { this.messageVersion = messageVersion; this.messageEncoder = new BinaryMessageEncoder(this, false, 0); this.maxReadPoolSize = maxReadPoolSize; this.maxWritePoolSize = maxWritePoolSize; this.maxSessionSize = maxSessionSize; this.thisLock = new object(); this.onStreamedReaderClose = new OnXmlDictionaryReaderClose(this.ReturnStreamedReader); this.readerQuotas = new XmlDictionaryReaderQuotas(); if (readerQuotas != null) { readerQuotas.CopyTo(this.readerQuotas); } this.binaryVersion = version; }
public PeerChannelFactory(PeerTransportBindingElement source, BindingContext ctx) : base(source, ctx) { this.source = source; foreach (BindingElement be in ctx.Binding.Elements) { MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement; if (mbe != null) { MessageEncoder = CreateEncoder <TChannel> (mbe); break; } } if (MessageEncoder == null) { MessageEncoder = new BinaryMessageEncoder(); } }
public NamedPipeChannelListener(NamedPipeTransportBindingElement source, BindingContext context) : base(context) { foreach (BindingElement be in context.Binding.Elements) { MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement; if (mbe != null) { MessageEncoder = CreateEncoder <TChannel> (mbe); quotas = mbe.GetProperty <XmlDictionaryReaderQuotas> (context); break; } } if (MessageEncoder == null) { MessageEncoder = new BinaryMessageEncoder(); } }
public NamedPipeChannelFactory(NamedPipeTransportBindingElement source, BindingContext ctx) : base(source, ctx) { foreach (BindingElement be in ctx.Binding.Elements) { MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement; if (mbe != null) { MessageEncoder = CreateEncoder <TChannel> (mbe); quotas = mbe.GetProperty <XmlDictionaryReaderQuotas> (ctx); break; } } if (MessageEncoder == null) { MessageEncoder = new BinaryMessageEncoder(); } this.source = source; }
private BinaryBufferedMessageData TakeBufferedData(BinaryMessageEncoder messageEncoder) { if (this.bufferedDataPool == null) { lock (this.ThisLock) { if (this.bufferedDataPool == null) { this.bufferedDataPool = new SynchronizedPool<BinaryBufferedMessageData>(this.maxReadPoolSize); } } } BinaryBufferedMessageData data = this.bufferedDataPool.Take(); if (data == null) { data = new BinaryBufferedMessageData(this, 2); } data.SetMessageEncoder(messageEncoder); return data; }
private BinaryBufferedMessageData TakeBufferedData(BinaryMessageEncoder messageEncoder) { if (this.bufferedDataPool == null) { lock (this.ThisLock) { if (this.bufferedDataPool == null) { this.bufferedDataPool = new SynchronizedPool <BinaryBufferedMessageData>(this.maxReadPoolSize); } } } BinaryBufferedMessageData data = this.bufferedDataPool.Take(); if (data == null) { data = new BinaryBufferedMessageData(this, 2); } data.SetMessageEncoder(messageEncoder); return(data); }
public TcpChannelFactory(TcpTransportBindingElement source, BindingContext ctx) { MessageEncoder encoder = null; XmlDictionaryReaderQuotas quotas = null; foreach (BindingElement be in ctx.RemainingBindingElements) { MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement; if (mbe != null) { encoder = CreateEncoder <TChannel> (mbe); quotas = mbe.GetProperty <XmlDictionaryReaderQuotas> (ctx); break; } } if (encoder == null) { encoder = new BinaryMessageEncoder(); } info = new TcpChannelInfo(source, encoder, quotas); }
public BinaryMessageEncoderFactory(MessageVersion messageVersion, int maxReadPoolSize, int maxWritePoolSize, int maxSessionSize, XmlDictionaryReaderQuotas readerQuotas, long maxReceivedMessageSize, BinaryVersion version, CompressionFormat compressionFormat) { _messageVersion = messageVersion; _maxReadPoolSize = maxReadPoolSize; _maxWritePoolSize = maxWritePoolSize; _maxSessionSize = maxSessionSize; _thisLock = new object(); _readerQuotas = new XmlDictionaryReaderQuotas(); if (readerQuotas != null) { readerQuotas.CopyTo(_readerQuotas); } _bufferedReadReaderQuotas = EncoderHelpers.GetBufferedReadQuotas(_readerQuotas); this.MaxReceivedMessageSize = maxReceivedMessageSize; _binaryVersion = version; _compressionFormat = compressionFormat; _messageEncoder = new BinaryMessageEncoder(this, false, 0); }
public BinaryMessageEncoderFactory(MessageVersion messageVersion, int maxReadPoolSize, int maxWritePoolSize, int maxSessionSize, XmlDictionaryReaderQuotas readerQuotas, long maxReceivedMessageSize, BinaryVersion version, CompressionFormat compressionFormat) { this.messageVersion = messageVersion; this.maxReadPoolSize = maxReadPoolSize; this.maxWritePoolSize = maxWritePoolSize; this.maxSessionSize = maxSessionSize; this.thisLock = new object(); this.onStreamedReaderClose = new OnXmlDictionaryReaderClose(ReturnStreamedReader); this.readerQuotas = new XmlDictionaryReaderQuotas(); if (readerQuotas != null) { readerQuotas.CopyTo(this.readerQuotas); } this.bufferedReadReaderQuotas = EncoderHelpers.GetBufferedReadQuotas(this.readerQuotas); this.MaxReceivedMessageSize = maxReceivedMessageSize; this.binaryVersion = version; this.compressionFormat = compressionFormat; this.messageEncoder = new BinaryMessageEncoder(this, false, 0); }
public TcpChannelListener(TcpTransportBindingElement source, BindingContext context) : base(context) { XmlDictionaryReaderQuotas quotas = null; foreach (BindingElement be in context.Binding.Elements) { MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement; if (mbe != null) { MessageEncoder = CreateEncoder <TChannel> (mbe); quotas = mbe.GetProperty <XmlDictionaryReaderQuotas> (context); break; } } if (MessageEncoder == null) { MessageEncoder = new BinaryMessageEncoder(); } info = new TcpChannelInfo(source, MessageEncoder, quotas); }
public void SetMessageEncoder(BinaryMessageEncoder messageEncoder) { _messageEncoder = messageEncoder; }
private BinaryBufferedMessageData TakeBufferedData(BinaryMessageEncoder messageEncoder) { if (_bufferedDataPool == null) { lock (ThisLock) { if (_bufferedDataPool == null) { //running = true; _bufferedDataPool = new SynchronizedPool<BinaryBufferedMessageData>(_maxReadPoolSize); } } } BinaryBufferedMessageData messageData = _bufferedDataPool.Take(); if (messageData == null) { messageData = new BinaryBufferedMessageData(this, maxPooledXmlReaderPerMessage); if (WcfEventSource.Instance.ReadPoolMissIsEnabled()) { WcfEventSource.Instance.ReadPoolMiss(messageData.GetType().Name); } } messageData.SetMessageEncoder(messageEncoder); return messageData; }
BinaryBufferedMessageData TakeBufferedData(BinaryMessageEncoder messageEncoder) { if (bufferedDataPool == null) { lock (ThisLock) { if (bufferedDataPool == null) { //running = true; bufferedDataPool = new SynchronizedPool<BinaryBufferedMessageData>(maxReadPoolSize); } } } BinaryBufferedMessageData messageData = bufferedDataPool.Take(); if (messageData == null) { messageData = new BinaryBufferedMessageData(this, maxPooledXmlReaderPerMessage); if (TD.ReadPoolMissIsEnabled()) { TD.ReadPoolMiss(messageData.GetType().Name); } } messageData.SetMessageEncoder(messageEncoder); return messageData; }
public BinaryMessageEncoderFactory( BinaryMessageEncodingBindingElement owner) { this.owner = owner; encoder = new BinaryMessageEncoder(this, false); }
public BinaryMessageEncoderFactory ( BinaryMessageEncodingBindingElement owner) { this.owner = owner; encoder = new BinaryMessageEncoder (this, false); }