Interface PeerConnection


public interface PeerConnection
A P2P connection to another node for plugin use.
  • Method Details

    • getAgreedCapabilities

      Set<? extends Capability> getAgreedCapabilities()
      Agreed capabilities between us and the peer.
      Returns:
      a set of shared capabilities between this node and the connected peer
    • capability

      Capability capability(String protocol)
      Returns the agreed capability corresponding to given protocol.
      Parameters:
      protocol - the name of the protocol
      Returns:
      the agreed capability corresponding to this protocol, returns null if no matching capability is supported
    • getPeer

      Peer getPeer()
      Data about the peer on the other side of this connection.
      Returns:
      A representation of the remote peer this node is connected to.
    • getPeerInfo

      PeerInfo getPeerInfo()
      Returns the Peer's Description.
      Returns:
      Peer Description
    • getLocalAddress

      InetSocketAddress getLocalAddress()
      Get local address.
      Returns:
      local address
    • getRemoteAddress

      InetSocketAddress getRemoteAddress()
      Get remote address.
      Returns:
      remote address
    • getRemoteEnode

      EnodeURL getRemoteEnode()
      Get remote enode URL.
      Returns:
      remote enode URL
    • getInitiatedAt

      long getInitiatedAt()
      Get the difference, measured in milliseconds, between the time this connection was initiated and midnight, January 1, 1970 UTC
      Returns:
      the time when this connection was initiated.
    • inboundInitiated

      boolean inboundInitiated()
      Check if connection was initiated inbound.
      Returns:
      true if inbound initiated
    • getStatusExchanged

      boolean getStatusExchanged()
      Check if status has been exchanged.
      Returns:
      true if status exchanged