Exemplo n.º 1
0
        private void FlushBufferedWriter()
        {
            var bufferedWriter = _writeBuffer;

            if (bufferedWriter == _outputWriter)
            {
                return;
            }
            _writeBuffer = _outputWriter;

            using (bufferedWriter)
            {
                _writeBuffer.Write((int)bufferedWriter.Length);
                bufferedWriter.WriteTo(_writeBuffer);
            }
        }
Exemplo n.º 2
0
        public void SetMethod(string method)
        {
            if (string.IsNullOrEmpty(method))
            {
                throw new ArgumentNullException("method");
            }
            if (_messageType != MessageType.Request)
            {
                throw new InvalidOperationException("Method is only allow in request messages.");
            }

            _writeBuffer.Write(method);
        }
Exemplo n.º 3
0
        private void FlushBufferedWriter()
        {
            var bufferedWriter = _writeBuffer;
            if (bufferedWriter == _outputWriter)
            {
                return;
            }
            _writeBuffer = _outputWriter;

            using (bufferedWriter)
            {
                _writeBuffer.Write((int)bufferedWriter.Length);
                bufferedWriter.WriteTo(_writeBuffer);
            }
        }