|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.transport.udp.EstablishmentManager
class EstablishmentManager
Coordinate the establishment of new sessions - both inbound and outbound. This has its own thread to add packets to the packet queue when necessary, as well as to drop any failed establishment attempts.
Field Summary | |
---|---|
static long |
MAX_TAG_VALUE
the relay tag is a 4-byte field in the protocol |
static int |
OB_MESSAGE_TIMEOUT
max before receiving a response to a single message during outbound establishment |
Constructor Summary | |
---|---|
EstablishmentManager(RouterContext ctx,
UDPTransport transport)
|
Method Summary | |
---|---|
void |
establish(OutNetMessage msg)
Send the message to its specified recipient by establishing a connection with them and sending it off. |
(package private) InboundEstablishState |
getInboundState(RemoteHostId from)
Grab the active establishing state |
(package private) OutboundEstablishState |
getOutboundState(RemoteHostId from)
Grab the active establishing state |
(package private) PeerState |
receiveData(OutboundEstablishState state)
A data packet arrived on an outbound connection being established, which means its complete (yay!). |
(package private) void |
receiveHolePunch(InetAddress from,
int fromPort)
Called from UDPReceiver. |
(package private) void |
receiveRelayResponse(RemoteHostId bob,
UDPPacketReader reader)
We are Alice, we sent a RelayRequest to Bob and got a response back. |
(package private) void |
receiveSessionConfirmed(RemoteHostId from,
UDPPacketReader reader)
got a SessionConfirmed (should only happen as part of an inbound establishment) |
(package private) void |
receiveSessionCreated(RemoteHostId from,
UDPPacketReader reader)
Got a SessionCreated (in response to our outbound SessionRequest) |
(package private) void |
receiveSessionDestroy(RemoteHostId from)
Got a SessionDestroy - maybe during an inbound establish? TODO - PacketHandler won't look up inbound establishes As this packet was essentially unauthenticated (i.e. |
(package private) void |
receiveSessionDestroy(RemoteHostId from,
OutboundEstablishState state)
Got a SessionDestroy during outbound establish |
(package private) void |
receiveSessionDestroy(RemoteHostId from,
PeerState state)
Got a SessionDestroy on an established conn |
(package private) void |
receiveSessionRequest(RemoteHostId from,
UDPPacketReader reader)
Got a SessionRequest (initiates an inbound establishment) |
boolean |
shouldAllowInboundEstablishment()
Should we allow another inbound establishment? Used to throttle outbound hole punches. |
void |
shutdown()
|
void |
startup()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int OB_MESSAGE_TIMEOUT
public static final long MAX_TAG_VALUE
Constructor Detail |
---|
public EstablishmentManager(RouterContext ctx, UDPTransport transport)
Method Detail |
---|
public void startup()
public void shutdown()
InboundEstablishState getInboundState(RemoteHostId from)
OutboundEstablishState getOutboundState(RemoteHostId from)
public void establish(OutNetMessage msg)
public boolean shouldAllowInboundEstablishment()
void receiveSessionRequest(RemoteHostId from, UDPPacketReader reader)
void receiveSessionConfirmed(RemoteHostId from, UDPPacketReader reader)
void receiveSessionCreated(RemoteHostId from, UDPPacketReader reader)
void receiveSessionDestroy(RemoteHostId from, PeerState state)
void receiveSessionDestroy(RemoteHostId from, OutboundEstablishState state)
void receiveSessionDestroy(RemoteHostId from)
PeerState receiveData(OutboundEstablishState state)
void receiveRelayResponse(RemoteHostId bob, UDPPacketReader reader)
void receiveHolePunch(InetAddress from, int fromPort)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |