Search in sources :

Example 1 with Router

use of me.matoosh.undernet.p2p.router.Router in project UnderNet by itsMatoosh.

the class UnderNet method setup.

/**
 * Sets up UnderNet.
 */
public static void setup(FileManager fileManager, ConfigurationProvider configProvider) {
    // Writing the init message.
    writeInitMessage();
    // Setting the secure random generator.
    secureRandom = new SecureRandom();
    // Setting the file manager.
    UnderNet.fileManager = fileManager;
    // Setting the config provider.
    UnderNet.configProvider = configProvider;
    networkConfig = configProvider.bind("network", NetworkConfig.class);
    // Loading up the node cache.
    EntryNodeCache.registerEvents();
    EntryNodeCache.load();
    // Setting up the self node.
    Node.self = new Node();
    // Setting up the router.
    router = new Router();
    router.setup();
}
Also used : Node(me.matoosh.undernet.p2p.node.Node) NetworkConfig(me.matoosh.undernet.p2p.config.NetworkConfig) SecureRandom(java.security.SecureRandom) Router(me.matoosh.undernet.p2p.router.Router)

Aggregations

SecureRandom (java.security.SecureRandom)1 NetworkConfig (me.matoosh.undernet.p2p.config.NetworkConfig)1 Node (me.matoosh.undernet.p2p.node.Node)1 Router (me.matoosh.undernet.p2p.router.Router)1