Interface PeerConnection
public interface PeerConnection
A P2P connection to another node for plugin use.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classException thrown when attempting to send to a disconnected peer. -
Method Summary
Modifier and TypeMethodDescriptioncapability(String protocol) Returns the agreed capability corresponding to given protocol.Set<? extends Capability> Agreed capabilities between us and the peer.longGet the difference, measured in milliseconds, between the time this connection was initiated and midnight, January 1, 1970 UTCGet local address.getPeer()Data about the peer on the other side of this connection.Returns the Peer's Description.Get remote address.Get remote enode URL.booleanCheck if status has been exchanged.booleanCheck if connection was initiated inbound.
-
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
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
-
getLocalAddress
-
getRemoteAddress
-
getRemoteEnode
-
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
-