class OutboundEstablishState extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
OutboundEstablishState.OutboundState
States for outbound SSU session establishment.
|
| 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 byte[] _aliceIP
protected int _alicePort
protected byte[] _bobIP
protected int _bobPort
protected final RouterContext _context
protected OutboundEstablishState.OutboundState _currentState
protected final long _establishBegin
protected long _lastSend
protected final Log _log
protected long _nextSend
protected long _receivedRelayTag
protected RemoteHostId _remoteHostId
protected final RouterIdentity _remotePeer
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 void addMessage(OutNetMessage msg)
public boolean complete()
public void confirmedPacketsSent()
public void dataReceived()
public void fail()
RemoteHostId getClaimedAddress()
public long getConfirmedSentTime()
public long getEstablishBeginTime()
public SessionKey getIntroKey()
public long getIntroNonce()
public long getIntroSentTime()
public long getLifetime()
public long getLifetime(long now)
public OutNetMessage getNextQueuedMessage()
public long getNextSendTime()
public byte[] getReceivedIP()
public int getReceivedPort()
public long getReceivedRelayTag()
public long getReceivedSignedOnTime()
public UDPAddress getRemoteAddress()
RemoteHostId getRemoteHostId()
public RouterIdentity getRemoteIdentity()
public long getRequestSentTime()
int getRTT()
public byte[] getSentIP()
public int getSentPort()
public long getSentSignedOnTime()
public OutboundEstablishState.OutboundState getState()
public int getVersion()
public void introduced(byte[] bobIP,
int bobPort)
public void introductionFailed()
public void introSent()
public boolean isExtendedOptionsAllowed()
public boolean isFirstMessageOurDSM()
public boolean needIntroduction()
protected void packetReceived()
boolean receiveHolePunch()
public void requestSent()
public void setIntroNonce(long nonce)
public boolean validateSessionCreated()