public class BroadcastTransmitter
extends java.lang.Object
BroadcastReceivers.
Note: This class is not threadsafe. Only one transmitter is allowed per broadcast buffer.
| Constructor and Description |
|---|
BroadcastTransmitter(AtomicBuffer buffer)
Construct a new broadcast transmitter based on an underlying
AtomicBuffer. |
| Modifier and Type | Method and Description |
|---|---|
int |
capacity()
Get the capacity of the underlying broadcast buffer.
|
int |
maxMsgLength()
Get the maximum message length that can be transmitted for a buffer.
|
void |
transmit(int msgTypeId,
DirectBuffer srcBuffer,
int srcIndex,
int length)
Transmit a message to
BroadcastReceivers via the broadcast buffer. |
public BroadcastTransmitter(AtomicBuffer buffer)
AtomicBuffer.
The underlying buffer must a power of 2 in size plus sufficient space
for the BroadcastBufferDescriptor.TRAILER_LENGTH.buffer - via which messages will be exchanged.java.lang.IllegalStateException - if the buffer capacity is not a power of 2
plus BroadcastBufferDescriptor.TRAILER_LENGTH in capacity.public int capacity()
public int maxMsgLength()
public void transmit(int msgTypeId,
DirectBuffer srcBuffer,
int srcIndex,
int length)
BroadcastReceivers via the broadcast buffer.msgTypeId - type of the message to be transmitted.srcBuffer - containing the encoded message to be transmitted.srcIndex - srcIndex in the source buffer at which the encoded message begins.length - in bytes of the encoded message.java.lang.IllegalArgumentException - of the msgTypeId is not valid,
or if the message length is greater than maxMsgLength().Copyright © 2014-2019 Real Logic Ltd. All Rights Reserved.