Class LocalHostDiscovery

  • All Implemented Interfaces:
    AutoCloseable, DrasylNodeComponent

    public class LocalHostDiscovery
    extends Object
    implements DrasylNodeComponent
    Uses the file system to discover other drasyl nodes running on the local computer.

    To do this, all nodes regularly write their current endpoints to the file system. At the same time the file system is monitored to detect new nodes. If the file system does not support monitoring, a fallback to polling is used.

    The discovery directory is scanned whenever communication with another peer occur.

    This discovery mechanism does not itself establish connections to other peers. Only PeerInformation are discovered and passed to the PeersManager. These information can then be used by the DirectConnectionsManager to establish connections.

    Inspired by: https://github.com/actoron/jadex/blob/10e464b230d7695dfd9bf2b36f736f93d69ee314/platform/base/src/main/java/jadex/platform/service/awareness/LocalHostAwarenessAgent.java