Interface EstablishState

All Known Implementing Classes:
EstablishBase, InboundEstablishState, OutboundNTCP2State

interface EstablishState
Handle the establishment
  • Method Summary

    Modifier and Type Method Description
    void close​(String reason, Exception e)
    Release resources on timeout.
    int getVersion()
    Get the NTCP version
    boolean isComplete()
    If synchronized on this, fails with deadlocks from all over via CSFI.isEstablished().
    boolean isCorrupt()
    did the handshake fail for some reason?
    void prepareOutbound()
    Does nothing.
    void receive​(ByteBuffer src)
    Parse the contents of the buffer as part of the handshake.
  • Method Details

    • receive

      void receive​(ByteBuffer src)
      Parse the contents of the buffer as part of the handshake. All data must be copied out of the buffer as Reader.processRead() will return it to the pool. If there are additional data in the buffer after the handshake is complete, the EstablishState is responsible for passing it to NTCPConnection.
      Throws:
      IllegalStateException
    • prepareOutbound

      void prepareOutbound()
      Does nothing. Outbound (Alice) must override. We are establishing an outbound connection, so prepare ourselves by queueing up the write of the first part of the handshake
      Throws:
      IllegalStateException
    • isCorrupt

      boolean isCorrupt()
      did the handshake fail for some reason?
    • isComplete

      boolean isComplete()
      If synchronized on this, fails with deadlocks from all over via CSFI.isEstablished(). Also CSFI.getFramedAveragePeerClockSkew().
      Returns:
      is the handshake complete and valid?
    • getVersion

      int getVersion()
      Get the NTCP version
      Returns:
      1, 2, or 0 if unknown
      Since:
      0.9.35
    • close

      void close​(String reason, Exception e)
      Release resources on timeout.
      Parameters:
      e - may be null
      Since:
      0.9.16