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); }
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(); }
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(); }
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); }