Exemplo n.º 1
0
        public virtual long AddPublication(string channel, int streamId)
        {
            long correlationId = _toDriverCommandBuffer.NextCorrelationId();

            _publicationMessage.ClientId(_clientId).CorrelationId(correlationId);

            _publicationMessage.StreamId(streamId).Channel(channel);

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

            return(correlationId);
        }
Exemplo n.º 2
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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 4
0
        public long AddPublication(string channel, int streamId)
        {
            long correlationId = _toDriverCommandBuffer.NextCorrelationId();

            _publicationMessage.CorrelationId(correlationId);

            _publicationMessage
            .StreamId(streamId)
            .Channel(channel);

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

            return(correlationId);
        }