devp2p / org.apache.tuweni.devp2p.v5 / UdpConnector

UdpConnector

interface UdpConnector (source)

Module, used for network communication. It accepts and sends incoming messages and also provides peer information, like node's ENR, key pair

Functions

attachObserver

Attach observer for listening processed messages

abstract fun attachObserver(observer: MessageObserver): Unit

detachObserver

Remove observer for listening processed message

abstract fun detachObserver(observer: MessageObserver): Unit

getAwaitingPongRecord

Retrieve enr of pinging node

abstract fun getAwaitingPongRecord(nodeId: Bytes): Bytes?

getEnr

Provides node's ENR

abstract fun getEnr(): EthereumNodeRecord

getEnrBytes

Provides node's ENR in RLP encoded representation

abstract fun getEnrBytes(): Bytes

getNodeKeyPair

Provides node's key pair

abstract fun getNodeKeyPair(): KeyPair

getNodeRecords

Provides enr storage of known nodes

abstract fun getNodeRecords(): ENRStorage

getNodesTable

Get kademlia routing table

abstract fun getNodesTable(): RoutingTable

getPendingMessage

Retrieve last sent message, in case if it unauthorized and node can resend with authentication header

abstract fun getPendingMessage(authTag: Bytes): TrackingMessage?

getSessionInitiatorKey

Provides node's session initiator key

abstract fun getSessionInitiatorKey(nodeId: Bytes): Bytes

getTicketHolder

Provides node's ticket holder

abstract fun getTicketHolder(): TicketHolder

getTopicRegistrar

Provides node's topic registrar

abstract fun getTopicRegistrar(): TopicRegistrar

getTopicTable

Provides node's topic table

abstract fun getTopicTable(): TopicTable

send

Sends udp message by socket address

abstract suspend fun send(address: InetSocketAddress, message: UdpMessage, destNodeId: Bytes, handshakeParams: HandshakeInitParameters? = null): Unit

start

Bootstraps receive loop for incoming message handling

abstract suspend fun start(): Unit

started

Gives information about connector, whether receive loop is working

abstract fun started(): Boolean

terminate

Shut downs both udp receive loop and sender socket

abstract suspend fun terminate(): Unit

Inheritors

DefaultUdpConnector

class DefaultUdpConnector : UdpConnector, CoroutineScope