示例#1
0
            public BinaryMessageEncoder(BinaryMessageEncoderFactory factory, bool isSession, int maxSessionSize)
            {
                _factory = factory;
                _isSession = isSession;
                _maxSessionSize = maxSessionSize;
                _remainingReaderSessionSize = maxSessionSize;
                _normalContentType = isSession ? factory._binaryVersion.SessionContentType : factory._binaryVersion.ContentType;
                _gzipCompressedContentType = isSession ? BinaryVersion.GZipVersion1.SessionContentType : BinaryVersion.GZipVersion1.ContentType;
                _deflateCompressedContentType = isSession ? BinaryVersion.DeflateVersion1.SessionContentType : BinaryVersion.DeflateVersion1.ContentType;
                _sessionCompressionFormat = _factory.CompressionFormat;
                _maxReceivedMessageSize = _factory.MaxReceivedMessageSize;

                switch (_factory.CompressionFormat)
                {
                    case CompressionFormat.Deflate:
                        _contentType = _deflateCompressedContentType;
                        break;
                    case CompressionFormat.GZip:
                        _contentType = _gzipCompressedContentType;
                        break;
                    default:
                        _contentType = _normalContentType;
                        break;
                }
            }
示例#2
0
		public BinaryMessageEncoder (BinaryMessageEncoderFactory owner, bool session)
		{
			this.owner = owner;
			this.session = session;
		}
示例#3
0
 public BinaryBufferedMessageData(BinaryMessageEncoderFactory factory, int maxPoolSize)
     : base(factory.RecycledStatePool)
 {
     _factory = factory;
     _readerPool = new Pool<XmlDictionaryReader>(maxPoolSize);
     _onClose = new OnXmlDictionaryReaderClose(OnXmlReaderClosed);
 }
            public BinaryMessageEncoder(BinaryMessageEncoderFactory factory, bool isSession, int maxSessionSize)
            {
                this.factory = factory;
                this.isSession = isSession;
                this.maxSessionSize = maxSessionSize;
                this.remainingReaderSessionSize = maxSessionSize;
                this.normalContentType = isSession ? factory.binaryVersion.SessionContentType : factory.binaryVersion.ContentType;
                this.gzipCompressedContentType = isSession ? BinaryVersion.GZipVersion1.SessionContentType : BinaryVersion.GZipVersion1.ContentType;
                this.deflateCompressedContentType = isSession ? BinaryVersion.DeflateVersion1.SessionContentType : BinaryVersion.DeflateVersion1.ContentType;
                this.sessionCompressionFormat = this.factory.CompressionFormat;
                this.maxReceivedMessageSize = this.factory.MaxReceivedMessageSize;

                switch (this.factory.CompressionFormat)
                {
                    case CompressionFormat.Deflate:
                        this.contentType = this.deflateCompressedContentType;
                        break;
                    case CompressionFormat.GZip:
                        this.contentType = this.gzipCompressedContentType;
                        break;
                    default:
                        this.contentType = this.normalContentType;
                        break;
                }
            }
示例#5
0
 public BinaryMessageEncoder(BinaryMessageEncoderFactory owner, bool session)
 {
     this.owner   = owner;
     this.session = session;
 }
 public BinaryMessageEncoder(BinaryMessageEncoderFactory factory, bool isSession, int maxSessionSize)
 {
     this.factory = factory;
     this.isSession = isSession;
     this.maxSessionSize = maxSessionSize;
     this.remainingReaderSessionSize = maxSessionSize;
 }
 public void SetMessageEncoder(BinaryMessageEncoderFactory.BinaryMessageEncoder messageEncoder)
 {
     this.messageEncoder = messageEncoder;
 }