Inheritance: RELOAD_MessageBody
Esempio n. 1
0
        public bool Init(Machine machine) {
#if false
            Console.Title = String.Format("{3}Node {0}:{1}, ID {2}", ReloadGlobals.HostName, ReloadGlobals.ListenPort, ReloadGlobals.LocalNodeID, ReloadGlobals.SimpleNodeId ? " DEMO " : "");
#endif
            IPAddress Address = null;

            if (ReloadGlobals.HostName != "") {
                Address = ReloadGlobals.IPAddressFromHost(m_ReloadConfig,
                  ReloadGlobals.HostName);
            }
            //TKTEST IETF
           // Address =  new IPAddress(new byte[] { 192, 168, 2, 147 });
            if (Address == null) {
                m_ReloadConfig.Logger(ReloadGlobals.TRACEFLAGS.T_ERROR,
                  "Couldn't figure out my IP Address");
                return false;
            }

            /*use the attach request functionaliy to store 
             * ip-address and port to ice candidates in local node */
            AttachReqAns attreq = new AttachReqAns();
            m_localnode = new Node(m_id, attreq.IPAddressToIceCandidate(
              Address, m_ReloadConfig.ListenPort));

            
            m_localnode.NoIceCandidates = m_localnode.IceCandidates;  // markus: backup of NOICE candidates


            m_routing_table = new RoutingTable(m_localnode, machine);
            m_ReloadConfig.LocalNode = m_localnode;

            m_ReloadConfig.Logger(ReloadGlobals.TRACEFLAGS.T_TOPO,
              String.Format("Local node is {0}", m_localnode));

            return true;
        }