scuttlebutt-discovery / org.apache.tuweni.scuttlebutt.discovery / ScuttlebuttLocalDiscoveryService

ScuttlebuttLocalDiscoveryService

open class ScuttlebuttLocalDiscoveryService (source)

Scuttlebutt local discovery service, based on the Scuttlebutt network protocol defined here. This service offers two functions:

It broadcasts to the local network every minute Scuttlebutt identities, as individual packets.

It listens to broadcasted packets on the local network and relays Scuttlebutt identities identified to listeners.

Constructors

<init>

ScuttlebuttLocalDiscoveryService(vertx: Vertx, logger: Logger, listenPort: Int, listenNetworkInterface: String, multicastAddress: String)

Default constructor.

Functions

addIdentityToBroadcastList

open fun addIdentityToBroadcastList(identity: LocalIdentity): Unit

Adds an identity to the ones to be broadcast by the service. Identities may be added at any time during the lifecycle of the service

addListener

open fun addListener(listener: Consumer<LocalIdentity>): Unit

Adds a listener to be notified when the service receives UDP packets that match Scuttlebutt identities. Listeners may be added at any time during the lifecycle of the service

start

open fun start(): AsyncCompletion

Starts the service.

stop

open fun stop(): AsyncCompletion

Stops the service.