MessageOutputStream.WriteStatus
class PacketLocal extends Packet implements MessageOutputStream.WriteStatus
_nacks, _optionFrom, _optionSignature, _session, 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, MIN_DELAY_CHOKE, SEND_DELAY_CHOKE, STREAM_ID_UNKNOWN
コンストラクタ | 説明 |
---|---|
PacketLocal(I2PAppContext ctx,
Destination to,
I2PSession session) |
not bound to a connection
|
PacketLocal(I2PAppContext ctx,
Destination to,
Connection con) |
bound to a connection
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
void |
ackReceived() |
|
void |
cancelled() |
|
java.lang.StringBuilder |
formatAsString() |
|
int |
getAckTime() |
how long after packet creation was it acked?
|
Connection |
getConnection() |
|
long |
getCreatedOn() |
|
SessionKey |
getKeyUsed() |
推奨されていません。
should always return null
|
long |
getLastSend() |
|
long |
getLifetime() |
|
int |
getNACKs() |
|
int |
getNumSends() |
|
SimpleTimer2.TimedEvent |
getResendEvent() |
|
java.util.Set<SessionTag> |
getTagsSent() |
推奨されていません。
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 |
setKeyUsed(SessionKey key) |
推奨されていません。
I2PSession throws out the tags
|
void |
setResendPacketEvent(SimpleTimer2.TimedEvent evt) |
|
void |
setTagsSent(java.util.Set<SessionTag> tags) |
推奨されていません。
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?
|
int |
writeSignedPacket(byte[] buffer,
int offset) |
Sign and write the packet to the buffer (starting at the offset) and return
the number of bytes written.
|
boolean |
writeSuccessful() |
did the write succeed?
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
acquirePayload, getAckThrough, getLocalPort, getNacks, getOptionalDelay, getOptionalFrom, getOptionalMaxSize, getOptionalSignature, getPayload, getPayloadSize, getReceiveStreamId, getRemotePort, getResendDelay, getSendStreamId, getSequenceNum, getSession, isFlagSet, logTCPDump, readPacket, releasePayload, setAckThrough, setFlag, setFlag, setLocalPort, setNacks, setOptionalDelay, setOptionalFrom, setOptionalMaxSize, setOptionalSignature, setPayload, setReceiveStreamId, setRemotePort, setResendDelay, setSendStreamId, setSequenceNum, toId, toString, verifySignature, writePacket, writePacket
public PacketLocal(I2PAppContext ctx, Destination to, I2PSession session)
public PacketLocal(I2PAppContext ctx, Destination to, Connection con)
public Destination getTo()
@Deprecated public SessionKey getKeyUsed()
@Deprecated public void setKeyUsed(SessionKey key)
@Deprecated public java.util.Set<SessionTag> getTagsSent()
@Deprecated public void setTagsSent(java.util.Set<SessionTag> tags)
public boolean shouldSign()
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 int writeSignedPacket(byte[] buffer, int offset) throws java.lang.IllegalStateException
buffer
- data to be writtenoffset
- starting point in the bufferjava.lang.IllegalStateException
- if there is data missing or otherwise b0rkedpublic java.lang.StringBuilder formatAsString()
formatAsString
クラス内 Packet
public void waitForAccept(int maxWaitMs) throws java.io.IOException, java.lang.InterruptedException
waitForAccept
インタフェース内 MessageOutputStream.WriteStatus
maxWaitMs
- MessageOutputStream is the only caller, generally with -1java.io.IOException
java.lang.InterruptedException
public void waitForCompletion(int maxWaitMs) throws java.io.IOException, java.lang.InterruptedException
waitForCompletion
インタフェース内 MessageOutputStream.WriteStatus
maxWaitMs
- -1 = foreverjava.io.IOException
java.lang.InterruptedException
public boolean writeAccepted()
MessageOutputStream.WriteStatus
writeAccepted
インタフェース内 MessageOutputStream.WriteStatus
public boolean writeFailed()
MessageOutputStream.WriteStatus
writeFailed
インタフェース内 MessageOutputStream.WriteStatus
public boolean writeSuccessful()
MessageOutputStream.WriteStatus
writeSuccessful
インタフェース内 MessageOutputStream.WriteStatus
public void logTCPDump()