net.i2p.router.transport.udp
Class EstablishmentManager

java.lang.Object
  extended bynet.i2p.router.transport.udp.EstablishmentManager

public class EstablishmentManager
extends java.lang.Object

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.


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(java.net.InetAddress fromHost, int fromPort)
          Grab the active establishing state
(package private)  OutboundEstablishState getOutboundState(java.net.InetAddress fromHost, int fromPort)
           
(package private)  PeerState receiveData(OutboundEstablishState state)
          A data packet arrived on an outbound connection being established, which means its complete (yay!).
(package private)  void receiveSessionConfirmed(java.lang.String from, UDPPacketReader reader)
          got a SessionConfirmed (should only happen as part of an inbound establishment)
(package private)  void receiveSessionCreated(java.lang.String from, UDPPacketReader reader)
          Got a SessionCreated (in response to our outbound SessionRequest)
(package private)  void receiveSessionRequest(java.lang.String from, java.net.InetAddress host, int port, UDPPacketReader reader)
          Got a SessionRequest (initiates an inbound establishment)
 void shutdown()
           
 void startup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EstablishmentManager

public EstablishmentManager(RouterContext ctx,
                            UDPTransport transport)
Method Detail

startup

public void startup()

shutdown

public void shutdown()

getInboundState

InboundEstablishState getInboundState(java.net.InetAddress fromHost,
                                      int fromPort)
Grab the active establishing state


getOutboundState

OutboundEstablishState getOutboundState(java.net.InetAddress fromHost,
                                        int fromPort)

establish

public void establish(OutNetMessage msg)
Send the message to its specified recipient by establishing a connection with them and sending it off. This call does not block, and on failure, the message is failed.


receiveSessionRequest

void receiveSessionRequest(java.lang.String from,
                           java.net.InetAddress host,
                           int port,
                           UDPPacketReader reader)
Got a SessionRequest (initiates an inbound establishment)


receiveSessionConfirmed

void receiveSessionConfirmed(java.lang.String from,
                             UDPPacketReader reader)
got a SessionConfirmed (should only happen as part of an inbound establishment)


receiveSessionCreated

void receiveSessionCreated(java.lang.String from,
                           UDPPacketReader reader)
Got a SessionCreated (in response to our outbound SessionRequest)


receiveData

PeerState receiveData(OutboundEstablishState state)
A data packet arrived on an outbound connection being established, which means its complete (yay!). This is a blocking call, more than I'd like...