Esempio n. 1
0
        /// <summary>
        ///     Message have been queued etc and are now OK for delivery
        /// </summary>
        /// <param name="frame"></param>
        private void DeliverMessage(MessageFrame frame)
        {
            //_extensionService.Prepare(frame, _connection);
            if (frame.Payload != null && _payloadDotNetType != frame.Payload.GetType())
            {
                _payloadDotNetType = frame.Payload.GetType();
                var dotNetFrame = _extensionService.CreateFrame("dotnet", _payloadDotNetType);
                _connection.SendMore(dotNetFrame);
            }
            if (_payloadSerializer != null)
            {
                _payloadSerializer.Serialize(frame);
            }

            _connection.Send(frame);
        }
        private void DeliverMessage(MessageFrame frame)
        {
            if (frame.PayloadBuffer.Count == 0)
            {
                Debugger.Break();
            }

            if (frame.Payload != null && _payloadSerializer != null)
            {
                _payloadSerializer.Serialize(frame);
                if (_payloadDotNetType != frame.Payload.GetType())
                {
                    _payloadDotNetType = frame.Payload.GetType();
                    var dotNetFrame = _extensionService.CreateFrame("dotnet", _payloadDotNetType);
                    _connection.SendMore(dotNetFrame);
                }
            }
            _connection.Send(frame);
        }
Esempio n. 3
0
        private void DeliverMessage(MessageFrame frame)
        {
            frame.SequenceNumber = ++_sequenceCounter;
            if (_sequenceCounter == ushort.MaxValue)
            {
                _sequenceCounter = 0;
            }

            if (frame.Payload != null && _payloadSerializer != null)
            {
                _payloadSerializer.Serialize(frame);
                if (_dotNetExtension != null && _outboundDotNetType != frame.Payload.GetType())
                {
                    _outboundDotNetType = frame.Payload.GetType();
                    var dotNetFrame = _extensionService.CreateFrame("dotnet", _outboundDotNetType);
                    _connection.SendMore(dotNetFrame);
                }
            }
            _connection.Send(frame);
        }