tuweni / org.apache.tuweni.rlpx.wire / DefaultWireConnection

DefaultWireConnection

class DefaultWireConnection : WireConnection (source)

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

Constructors

<init>

Default constructor.

DefaultWireConnection(nodeId: Bytes!, peerNodeId: Bytes!, writer: Consumer<RLPxMessage!>!, afterHandshakeListener: Consumer<HelloMessage!>!, disconnectHandler: Runnable!, subprotocols: LinkedHashMap<SubProtocol!, SubProtocolHandler!>!, p2pVersion: Int, clientId: String!, advertisedPort: Int, ready: CompletableAsyncResult<WireConnection!>!, peerHost: String!, peerPort: Int)

Functions

agreedSubprotocols

fun agreedSubprotocols(): MutableCollection<SubProtocolIdentifier!>!

disconnect

Sends a message to the peer explaining that we are about to disconnect.

fun disconnect(reason: DisconnectReason!): Unit

getDisconnectReason

fun getDisconnectReason(): DisconnectReason!

getPeerHello

fun getPeerHello(): HelloMessage!

handleConnectionStart

fun handleConnectionStart(): Unit

isDisconnectReceived

fun isDisconnectReceived(): Boolean

isDisconnectRequested

fun isDisconnectRequested(): Boolean

messageReceived

fun messageReceived(message: RLPxMessage!): Unit

peerHost

fun peerHost(): String!

peerPort

fun peerPort(): Int

peerPublicKey

fun peerPublicKey(): PublicKey!

registerListener

fun registerListener(listener: EventListener!): Unit

sendMessage

fun sendMessage(subProtocolIdentifier: SubProtocolIdentifier!, messageType: Int, message: Bytes!): Unit

sendPing

Sends a ping message to the remote peer.

fun sendPing(): AsyncCompletion!

supports

fun supports(subProtocolIdentifier: SubProtocolIdentifier!): Boolean

toString

fun toString(): String