class OutboundEstablishState extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OutboundEstablishState.OutboundState |
Modifier and Type | Field and Description |
---|---|
protected byte[] |
_aliceIP |
protected int |
_alicePort |
protected byte[] |
_bobIP |
protected int |
_bobPort |
protected RouterContext |
_context |
protected OutboundEstablishState.OutboundState |
_currentState |
protected long |
_establishBegin |
protected long |
_lastSend |
protected Log |
_log |
protected long |
_nextSend |
protected long |
_receivedRelayTag |
protected RemoteHostId |
_remoteHostId |
protected RouterIdentity |
_remotePeer |
protected int |
_requestSentCount |
protected long |
_requestSentTime |
protected int |
_rtt |
protected static long |
RETRANSMIT_DELAY
basic delay before backoff
Transmissions at 0, 1.25, 3.75, 8.75 sec
This should be a little longer than for inbound.
|
Modifier | Constructor and Description |
---|---|
protected |
OutboundEstablishState(RouterContext ctx,
RemoteHostId claimedAddress,
RemoteHostId remoteHostId,
RouterIdentity remotePeer,
boolean needIntroduction,
SessionKey introKey,
UDPAddress addr)
For SSU2
|
Modifier and Type | Method and Description |
---|---|
void |
addMessage(OutNetMessage msg)
Queue a message to be sent after the session is established.
|
boolean |
complete() |
void |
confirmedPacketsSent()
note that we just sent the SessionConfirmed packet
|
void |
dataReceived()
we have received a real data packet, so we're done establishing
|
void |
fail()
The SessionCreated validation failed
|
(package private) RemoteHostId |
getClaimedAddress()
This will never be a hash-based address.
|
long |
getConfirmedSentTime() |
long |
getEstablishBeginTime() |
SessionKey |
getIntroKey()
Bob's introduction key, as published in the netdb
|
long |
getIntroNonce() |
long |
getIntroSentTime() |
long |
getLifetime()
how long have we been trying to establish this session?
|
long |
getLifetime(long now)
how long have we been trying to establish this session?
|
OutNetMessage |
getNextQueuedMessage() |
long |
getNextSendTime() |
byte[] |
getReceivedIP() |
int |
getReceivedPort() |
long |
getReceivedRelayTag() |
long |
getReceivedSignedOnTime() |
UDPAddress |
getRemoteAddress() |
(package private) RemoteHostId |
getRemoteHostId()
This should be what the state is currently indexed by in the _outboundStates table.
|
RouterIdentity |
getRemoteIdentity() |
long |
getRequestSentTime() |
(package private) int |
getRTT() |
byte[] |
getSentIP()
The remote side (Bob) - note that in some places he's called Charlie.
|
int |
getSentPort()
The remote side (Bob) - note that in some places he's called Charlie.
|
long |
getSentSignedOnTime() |
OutboundEstablishState.OutboundState |
getState() |
int |
getVersion() |
void |
introduced(byte[] bobIP,
int bobPort)
This changes the remoteHostId from a hash-based one or possibly
incorrect IP/port to what the introducer told us.
|
void |
introductionFailed() |
void |
introSent()
note that we just sent the RelayRequest packet
|
boolean |
isExtendedOptionsAllowed()
Are we allowed to send extended options to this peer?
|
boolean |
isFirstMessageOurDSM()
Is the first message queued our own DatabaseStoreMessage?
|
boolean |
needIntroduction()
Should we ask this peer to be an introducer for us?
Ignored unless allowExtendedOptions is true
|
protected void |
packetReceived()
Call from synchronized method only
|
(package private) boolean |
receiveHolePunch()
Accelerate response to RelayResponse if we haven't sent it yet.
|
void |
requestSent()
note that we just sent the SessionRequest packet
|
void |
setIntroNonce(long nonce) |
String |
toString() |
boolean |
validateSessionCreated()
Blocking call (run in the establisher thread) to determine if the
session was created properly.
|
protected final RouterContext _context
protected final Log _log
protected byte[] _bobIP
protected int _bobPort
protected byte[] _aliceIP
protected int _alicePort
protected long _receivedRelayTag
protected final long _establishBegin
protected long _lastSend
protected long _nextSend
protected RemoteHostId _remoteHostId
protected final RouterIdentity _remotePeer
protected OutboundEstablishState.OutboundState _currentState
protected int _requestSentCount
protected long _requestSentTime
protected int _rtt
protected static final long RETRANSMIT_DELAY
protected OutboundEstablishState(RouterContext ctx, RemoteHostId claimedAddress, RemoteHostId remoteHostId, RouterIdentity remotePeer, boolean needIntroduction, SessionKey introKey, UDPAddress addr)
public int getVersion()
public OutboundEstablishState.OutboundState getState()
public boolean complete()
public UDPAddress getRemoteAddress()
public void setIntroNonce(long nonce)
public long getIntroNonce()
public boolean isExtendedOptionsAllowed()
public boolean needIntroduction()
int getRTT()
public void addMessage(OutNetMessage msg)
public boolean isFirstMessageOurDSM()
public OutNetMessage getNextQueuedMessage()
public RouterIdentity getRemoteIdentity()
public SessionKey getIntroKey()
public byte[] getSentIP()
public int getSentPort()
public boolean validateSessionCreated()
public void fail()
public long getReceivedRelayTag()
public long getSentSignedOnTime()
public long getReceivedSignedOnTime()
public byte[] getReceivedIP()
public int getReceivedPort()
public void confirmedPacketsSent()
public long getConfirmedSentTime()
public void requestSent()
public long getRequestSentTime()
public void introSent()
public long getIntroSentTime()
public void introductionFailed()
public void introduced(byte[] bobIP, int bobPort)
boolean receiveHolePunch()
public long getLifetime()
public long getLifetime(long now)
public long getEstablishBeginTime()
public long getNextSendTime()
RemoteHostId getRemoteHostId()
RemoteHostId getClaimedAddress()
public void dataReceived()
protected void packetReceived()