Brunet.Applications.BasicNode.CreatePrivateNode C# (CSharp) Method

CreatePrivateNode() protected method

Create a PrivateNode given a shared node and a node_config.
protected CreatePrivateNode ( ApplicationNode shared, NodeConfig node_config ) : void
shared ApplicationNode
node_config NodeConfig
return void
    protected void CreatePrivateNode(ApplicationNode shared,
        NodeConfig node_config)
    {
      // Not necessary, but its nice to map the public and private overlay nodes
      node_config.NodeAddress = shared.Node.Address.ToString();
      ApplicationNode app_node = CreateNode(node_config);

      EdgeListener el = new SubringEdgeListener(shared.Node, app_node.Node);
      if(node_config.Security.SecureEdgesEnabled) {
        el = new SecureEdgeListener(el, app_node.SecurityOverlord);
      }
      app_node.Node.AddEdgeListener(el);
      Discovery d = new DhtDiscovery(app_node.Node as StructuredNode,
          shared.Dht, shared.Node.Realm, shared.DhtProxy);
      app_node.Node.AddTADiscovery(d);
      shared.PrivateNode = app_node;
    }