Esempio n. 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));
     });
 }
Esempio n. 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));
            });
        }
Esempio n. 3
0
        public long RemoveCounter(long registrationId)
        {
            long correlationId = _toDriverCommandBuffer.NextCorrelationId();

            _removeMessage.RegistrationId(registrationId).CorrelationId(correlationId);

            if (!_toDriverCommandBuffer.Write(ControlProtocolEvents.REMOVE_COUNTER, _buffer, 0,
                                              RemoveMessageFlyweight.Length()))
            {
                throw new AeronException("Could not write remove counter command");
            }

            return(correlationId);
        }
Esempio n. 4
0
        public long RemoveSubscription(long registrationId)
        {
            long correlationId = _toDriverCommandBuffer.NextCorrelationId();

            _removeMessage.RegistrationId(registrationId).CorrelationId(correlationId);

            if (!_toDriverCommandBuffer.Write(ControlProtocolEvents.REMOVE_SUBSCRIPTION, _buffer, 0,
                                              RemoveMessageFlyweight.Length()))
            {
                throw new AeronException("Could not write remove subscription message");
            }

            return(correlationId);
        }
Esempio n. 5
0
        public long RemovePublication(long registrationId)
#endif
        {
            long correlationId = _toDriverCommandBuffer.NextCorrelationId();

            _removeMessage.RegistrationId(registrationId).CorrelationId(correlationId);

            if (!_toDriverCommandBuffer.Write(ControlProtocolEvents.REMOVE_PUBLICATION, _buffer, 0, RemoveMessageFlyweight.Length()))
            {
                throw new AeronException("Could not write remove publication command");
            }

            return(correlationId);
        }
Esempio n. 6
0
        public virtual long RemovePublication(long registrationId)
        {
            long correlationId = _toDriverCommandBuffer.NextCorrelationId();

            _removeMessage.CorrelationId(correlationId);
            _removeMessage.RegistrationId(registrationId);

            if (!_toDriverCommandBuffer.Write(ControlProtocolEvents.REMOVE_PUBLICATION, _buffer, 0, RemoveMessageFlyweight.Length()))
            {
                throw new InvalidOperationException("could not write publication remove message");
            }

            return(correlationId);
        }