net.i2p.router.transport.udp

## Class EstablishmentManager

- java.lang.Object
- - net.i2p.router.transport.udp.EstablishmentManager

-      class EstablishmentManager
      extends 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.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `MAX_TAG_VALUE`
    `static String` | `PROP_MAX_CONCURRENT_ESTABLISH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EstablishmentManager(RouterContext ctx, UDPTransport transport)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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)`
    `(package private) PeerState` | `receiveData(OutboundEstablishState state)` A data packet arrived on an outbound connection being established, which means its complete (yay!).
    `(package private) void` | `receiveRelayResponse(RemoteHostId bob, UDPPacketReader reader)`
    `(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 after an inbound establish
    `(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)
    `void` | `shutdown()`
    `void` | `startup()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PROP_MAX_CONCURRENT_ESTABLISH

          public static final String PROP_MAX_CONCURRENT_ESTABLISH

      See Also:
        Constant Field Values

    - #### MAX_TAG_VALUE

          public static final long MAX_TAG_VALUE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EstablishmentManager

          public EstablishmentManager(RouterContext ctx,
                              UDPTransport transport)

  - ### Method Detail

    - #### startup

          public void startup()

    - #### shutdown

          public void shutdown()

    - #### getInboundState

          InboundEstablishState getInboundState(RemoteHostId from)

      Grab the active establishing state

    - #### getOutboundState

          OutboundEstablishState getOutboundState(RemoteHostId from)

    - #### 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(RemoteHostId from,
                                   UDPPacketReader reader)

      Got a SessionRequest (initiates an inbound establishment)

    - #### receiveSessionConfirmed

          void receiveSessionConfirmed(RemoteHostId from,
                                     UDPPacketReader reader)

      got a SessionConfirmed (should only happen as part of an inbound establishment)

    - #### receiveSessionCreated

          void receiveSessionCreated(RemoteHostId from,
                                   UDPPacketReader reader)

      Got a SessionCreated (in response to our outbound SessionRequest)

    - #### receiveSessionDestroy

          void receiveSessionDestroy(RemoteHostId from,
                                   PeerState state)

      Got a SessionDestroy on an established conn

    - #### receiveSessionDestroy

          void receiveSessionDestroy(RemoteHostId from,
                                   OutboundEstablishState state)

      Got a SessionDestroy during outbound establish

    - #### receiveSessionDestroy

          void receiveSessionDestroy(RemoteHostId from)

      Got a SessionDestroy - maybe after an inbound establish

    - #### 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...

    - #### receiveRelayResponse

          void receiveRelayResponse(RemoteHostId bob,
                                  UDPPacketReader reader)