class OutboundMessageFragments extends Object
getNextVolley(). This also honors per-peer throttling, taking
note of each peer's allocations. If a message has each of its fragments
sent more than a certain number of times, it is failed out. In addition,
this instance also receives notification of message ACKs from the
InboundMessageFragments, signaling that we can stop sending a
message.| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
MAX_VOLLEYS |
| Constructor and Description |
|---|
OutboundMessageFragments(RouterContext ctx,
UDPTransport transport) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(List<OutboundMessageState> states,
PeerState peer)
Short circuit the OutNetMessage, letting us send multiple messages
reliably and efficiently.
|
void |
add(OutboundMessageState state,
PeerState peer)
Short circuit the OutNetMessage, letting us send the establish
complete message reliably.
|
void |
add(OutNetMessage msg)
Add a new message to the active pool
|
void |
add(PeerState peer,
int size)
Add the peer to the list of peers wanting to transmit something.
|
(package private) void |
dropPeer(PeerState peer) |
List<UDPPacket> |
getNextVolley()
Fetch all the packets for a message volley, blocking until there is a
message which can be fully transmitted (or the transport is shut down).
|
(package private) void |
nudge()
Wakes up the packet pusher thread.
|
void |
shutdown() |
void |
startup() |
static final int MAX_VOLLEYS
public OutboundMessageFragments(RouterContext ctx, UDPTransport transport)
public void add(List<OutboundMessageState> states, PeerState peer)
public void add(OutboundMessageState state, PeerState peer)
public void add(OutNetMessage msg)
public void add(PeerState peer, int size)
size - the minimum size we can send, or 0 to always notifyvoid dropPeer(PeerState peer)
public List<UDPPacket> getNextVolley()
void nudge()
public void shutdown()
public void startup()