コード例 #1
0
 public void ThreadSendsRemoveChannelMessage()
 {
     conductor.RemovePublication(CORRELATION_ID);
     AssertReadsOneMessage((msgTypeId, buffer, index, length) =>
     {
         RemoveMessageFlyweight message = new RemoveMessageFlyweight();
         message.Wrap(buffer, index);
         Assert.That(msgTypeId, Is.EqualTo(ControlProtocolEvents.REMOVE_PUBLICATION));
         Assert.That(message.RegistrationId(), Is.EqualTo(CORRELATION_ID));
     });
 }
コード例 #2
0
        public void ThreadSendsRemoveSubscriberMessage()
        {
            conductor.RemoveSubscription(CORRELATION_ID);

            AssertReadsOneMessage((msgTypeId, buffer, index, length) =>
            {
                RemoveMessageFlyweight removeMessage = new RemoveMessageFlyweight();
                removeMessage.Wrap(buffer, index);
                Assert.That(msgTypeId, Is.EqualTo(ControlProtocolEvents.REMOVE_SUBSCRIPTION));
                Assert.That(removeMessage.RegistrationId(), Is.EqualTo(CORRELATION_ID));
            });
        }
コード例 #3
0
        public DriverProxy(IRingBuffer toDriverCommandBuffer)
        {
            if (toDriverCommandBuffer == null)
            {
                throw new ArgumentNullException(nameof(toDriverCommandBuffer));
            }

            _toDriverCommandBuffer = toDriverCommandBuffer;

            _publicationMessage.Wrap(_buffer, 0);
            _subscriptionMessage.Wrap(_buffer, 0);

            _correlatedMessage.Wrap(_keepaliveBuffer, 0);
            _removeMessage.Wrap(_buffer, 0);

            _clientId = toDriverCommandBuffer.NextCorrelationId();
        }
コード例 #4
0
ファイル: DriverProxy.cs プロジェクト: zhangbo27/Aeron.NET
        public DriverProxy(IRingBuffer toDriverCommandBuffer, long clientId)
        {
            if (toDriverCommandBuffer == null)
            {
                throw new ArgumentNullException(nameof(toDriverCommandBuffer));
            }

            _toDriverCommandBuffer = toDriverCommandBuffer;

            _publicationMessage.Wrap(_buffer, 0);
            _subscriptionMessage.Wrap(_buffer, 0);

            _correlatedMessage.Wrap(_buffer, 0);
            _removeMessage.Wrap(_buffer, 0);
            _destinationMessage.Wrap(_buffer, 0);

            _correlatedMessage.ClientId(clientId);
        }