tuweni / org.apache.tuweni.rlpx.wire / WireConnection

WireConnection

interface WireConnection (source)

A stateful connection between two peers under the Devp2p wire protocol.

Types

Event

class Event

EventListener

Listener of events occurring on the connection.

interface EventListener

Functions

agreedSubprotocols

Provides the subprotocols the connection supports in common with the service.

abstract fun agreedSubprotocols(): MutableCollection<SubProtocolIdentifier!>!

getDisconnectReason

If the connection is disconnected, the reason for which the connection is disconnected.

abstract fun getDisconnectReason(): DisconnectReason!

getPeerHello

Peer hello message sent during the handshake.

abstract fun getPeerHello(): HelloMessage!

isDisconnectReceived

Whether the peer asked to disconnect

abstract fun isDisconnectReceived(): Boolean

isDisconnectRequested

Whether this service asked to disconnect

abstract fun isDisconnectRequested(): Boolean

peerHost

Network interface associated with the wire connection

abstract fun peerHost(): String!

peerPort

Port associated with the wire connection

abstract fun peerPort(): Int

peerPublicKey

Public key of the peer associated with the wire connection

abstract fun peerPublicKey(): PublicKey!

registerListener

Registers a listener to consume events sent by this connection.

abstract fun registerListener(listener: EventListener!): Unit

supports

Returns true if the connection supports the subprotocol

abstract fun supports(subProtocolIdentifier: SubProtocolIdentifier!): Boolean

uri

Provides the identity of the connection

open fun uri(): String!

Inheritors

DefaultWireConnection

A stateful connection between two peers under the Devp2p wire protocol.

class DefaultWireConnection : WireConnection