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
abstract fun attachObserver(observer: MessageObserver): Unit
Attach observer for listening processed messages |
|
abstract fun detachObserver(observer: MessageObserver): Unit
Remove observer for listening processed message |
|
abstract fun getAwaitingPongRecord(nodeId: Bytes): Bytes?
Retrieve enr of pinging node |
|
abstract fun getEnr(): EthereumNodeRecord
Provides node's ENR |
|
abstract fun getEnrBytes(): Bytes
Provides node's ENR in RLP encoded representation |
|
abstract fun getNodeKeyPair(): KeyPair
Provides node's key pair |
|
abstract fun getNodeRecords(): ENRStorage
Provides enr storage of known nodes |
|
abstract fun getNodesTable(): RoutingTable
Get kademlia routing table |
|
abstract fun getPendingMessage(authTag: Bytes): TrackingMessage?
Retrieve last sent message, in case if it unauthorized and node can resend with authentication header |
|
abstract fun getSessionInitiatorKey(nodeId: Bytes): Bytes
Provides node's session initiator key |
|
abstract fun getTicketHolder(): TicketHolder
Provides node's ticket holder |
|
abstract fun getTopicRegistrar(): TopicRegistrar
Provides node's topic registrar |
|
abstract fun getTopicTable(): TopicTable
Provides node's topic table |
|
abstract suspend fun send(address: InetSocketAddress, message: UdpMessage, destNodeId: Bytes, handshakeParams: HandshakeInitParameters? = null): Unit
Sends udp message by socket address |
|
abstract suspend fun start(): Unit
Bootstraps receive loop for incoming message handling |
|
abstract fun started(): Boolean
Gives information about connector, whether receive loop is working |
|
abstract suspend fun terminate(): Unit
Shut downs both udp receive loop and sender socket |
class DefaultUdpConnector : UdpConnector, CoroutineScope |