示例#1
0
文件: Router.cs 项目: itfenom/i2p-cs
        /// <summary>
        /// Start the router with the current RouterContext settings.
        /// </summary>
        public static void Start()
        {
            lock ( StartedLock )
            {
                if (Started)
                {
                    return;
                }

                try
                {
                    var rci = RouterContext.Inst;
                    NetDb.Start();

                    Logging.Log("I: " + RouterContext.Inst.MyRouterInfo.ToString());
                    Logging.Log("Published: " + RouterContext.Inst.Published.ToString());

                    Logging.Log("Connecting...");
                    TransportProvider.Start();
                    TunnelProvider.Start();

                    ClientMgr        = new ClientTunnelProvider(TunnelProvider.Inst);
                    ExplorationMgr   = new ExplorationTunnelProvider(TunnelProvider.Inst);
                    TransitTunnelMgr = new TransitTunnelProvider(TunnelProvider.Inst);

                    Worker = new Thread(Run)
                    {
                        Name         = "Router",
                        IsBackground = true
                    };
                    Worker.Start();

                    NetDb.Inst.IdentHashLookup.LeaseSetReceived += IdentHashLookup_LeaseSetReceived;
                    NetDb.Inst.IdentHashLookup.LookupFailure    += IdentHashLookup_LookupFailure;

                    Started = true;
                }
                catch (Exception ex)
                {
                    Logging.Log(ex);
                }
            }
        }
示例#2
0
文件: Router.cs 项目: kyapp69/i2p-cs
        public static void Start()
        {
            if (Started)
            {
                return;
            }

            var rci = RouterContext.Inst;

            NetDb.Start();

            Logging.Log("I: " + RouterContext.Inst.MyRouterInfo.ToString());
            Logging.Log("Published: " + RouterContext.Inst.Published.ToString());

            Logging.Log("Connecting...");
            TransportProvider.Start();
            TunnelProvider.Start();

            Started = true;
        }