class PacketLocal extends Packet implements MessageOutputStream.WriteStatus
DEFAULT_MAX_SIZE, FLAG_CLOSE, FLAG_DELAY_REQUESTED, FLAG_ECHO, FLAG_FROM_INCLUDED, FLAG_MAX_PACKET_SIZE_INCLUDED, FLAG_NO_ACK, FLAG_PROFILE_INTERACTIVE, FLAG_RESET, FLAG_SIGNATURE_INCLUDED, FLAG_SIGNATURE_REQUESTED, FLAG_SYNCHRONIZE, MAX_DELAY_REQUEST, MAX_PAYLOAD_SIZE, MAX_STREAM_ID, STREAM_ID_UNKNOWN
Constructor and Description |
---|
PacketLocal(I2PAppContext ctx,
Destination to)
not bound to a connection
|
PacketLocal(I2PAppContext ctx,
Destination to,
Connection con) |
Modifier and Type | Method and Description |
---|---|
void |
ackReceived() |
void |
cancelled() |
StringBuilder |
formatAsString() |
int |
getAckTime()
how long after packet creation was it acked?
|
Connection |
getConnection() |
long |
getCreatedOn() |
SessionKey |
getKeyUsed()
Deprecated.
should always return null
|
long |
getLastSend() |
long |
getLifetime() |
int |
getNACKs() |
int |
getNumSends() |
SimpleTimer2.TimedEvent |
getResendEvent() |
Set<SessionTag> |
getTagsSent()
Deprecated.
should always return null or an empty set
|
Destination |
getTo() |
void |
incrementNACKs()
Will force a fast restransmit on the 3rd call (FAST_RETRANSMIT_THRESHOLD)
but only if it's the lowest unacked (see Connection.ResendPacketEvent)
|
void |
incrementSends() |
void |
logTCPDump()
Generate a pcap/tcpdump-compatible format,
so we can use standard debugging tools.
|
void |
prepare()
last minute update of ack fields, just before write/sign
|
void |
setKeyUsed(SessionKey key)
Deprecated.
I2PSession throws out the tags
|
void |
setResendPacketEvent(SimpleTimer2.TimedEvent evt) |
void |
setTagsSent(Set<SessionTag> tags)
Deprecated.
I2PSession throws out the tags
|
boolean |
shouldSign() |
void |
waitForAccept(int maxWaitMs)
Blocks until outbound window is not full.
|
void |
waitForCompletion(int maxWaitMs)
block until the packet is acked from the far end
|
boolean |
writeAccepted()
Was the write was accepted.
|
boolean |
writeFailed()
did the write fail?
|
boolean |
writeSuccessful()
did the write succeed?
|
acquirePayload, getAckThrough, getLocalPort, getNacks, getOptionalDelay, getOptionalFrom, getOptionalMaxSize, getOptionalSignature, getPayload, getPayloadSize, getReceiveStreamId, getRemotePort, getResendDelay, getSendStreamId, getSequenceNum, isFlagSet, logTCPDump, readPacket, releasePayload, setAckThrough, setFlag, setFlag, setLocalPort, setNacks, setOptionalDelay, setOptionalFrom, setOptionalMaxSize, setOptionalSignature, setPayload, setReceiveStreamId, setRemotePort, setResendDelay, setSendStreamId, setSequenceNum, toId, toString, verifySignature, writePacket, writeSignedPacket
public PacketLocal(I2PAppContext ctx, Destination to)
public PacketLocal(I2PAppContext ctx, Destination to, Connection con)
public Destination getTo()
public SessionKey getKeyUsed()
public void setKeyUsed(SessionKey key)
public Set<SessionTag> getTagsSent()
public void setTagsSent(Set<SessionTag> tags)
public boolean shouldSign()
public void prepare()
public long getCreatedOn()
public long getLifetime()
public void incrementSends()
public void ackReceived()
public void cancelled()
public SimpleTimer2.TimedEvent getResendEvent()
public int getAckTime()
public int getNumSends()
public long getLastSend()
public Connection getConnection()
public void incrementNACKs()
public int getNACKs()
public void setResendPacketEvent(SimpleTimer2.TimedEvent evt)
public StringBuilder formatAsString()
formatAsString
in class Packet
public void waitForAccept(int maxWaitMs) throws IOException, InterruptedException
waitForAccept
in interface MessageOutputStream.WriteStatus
maxWaitMs
- MessageOutputStream is the only caller, generally with -1IOException
InterruptedException
public void waitForCompletion(int maxWaitMs) throws IOException, InterruptedException
waitForCompletion
in interface MessageOutputStream.WriteStatus
maxWaitMs
- -1 = foreverIOException
InterruptedException
public boolean writeAccepted()
MessageOutputStream.WriteStatus
writeAccepted
in interface MessageOutputStream.WriteStatus
public boolean writeFailed()
MessageOutputStream.WriteStatus
writeFailed
in interface MessageOutputStream.WriteStatus
public boolean writeSuccessful()
MessageOutputStream.WriteStatus
writeSuccessful
in interface MessageOutputStream.WriteStatus
public void logTCPDump()