public class UtpAckHandler extends Object
| Constructor and Description |
|---|
UtpAckHandler(UtpSocketImpl socket)
Creates a new Utp Acknowledgement handler.
|
| Modifier and Type | Method and Description |
|---|---|
int |
countBytesInFlight() |
short |
getAcknowledgeNumber() |
boolean |
hasPacketsInFlight() |
boolean |
isInitialised() |
Optional<UtpPacket> |
onReceivedPacket(UtpPacket receivedPacket)
Event to be called on every packet we receive from the other end.
|
void |
onReset()
Event to be called when
UtpProtocol.ST_RESET is received. |
void |
registerPacket(UtpPacket packet)
Registers the we've sent a new packet.
|
String |
toString() |
public UtpAckHandler(UtpSocketImpl socket)
socket - The socket for which this handler is handling acknowledgements.public void registerPacket(UtpPacket packet)
packet - The packet we've sent.public Optional<UtpPacket> onReceivedPacket(UtpPacket receivedPacket) throws IOException
receivedPacket - The packet we received.IOExceptionpublic void onReset()
UtpProtocol.ST_RESET is received.public short getAcknowledgeNumber()
public int countBytesInFlight()
public boolean hasPacketsInFlight()
true when there is at least one packet in flight.public boolean isInitialised()
true when the socket has engaged with the handshake and thus has a base acknowledgeNumber set.Copyright © 2016. All rights reserved.