Esempio n. 1
0
 internal TeleportWorkItem(NetworkEngine engine, string address, object state, int httpPort,
                           int networkTimeoutMsec, TerrariumLed led)
 {
     _engine             = engine;
     _address            = address;
     _state              = state;
     _httpPort           = httpPort;
     _peerConnectionLed  = led;
     _networkTimeoutMsec = networkTimeoutMsec;
 }
Esempio n. 2
0
        internal void ShutdownNetwork()
        {
            if (announceThread != null)
            {
                announceThread.Abort();
            }

            // Stop Listening
            StopHttpNamespaceManager();

            _discoveryLed      = null;
            _peerConnectionLed = null;
        }
Esempio n. 3
0
        internal void InitializeNetwork(string peerChannel, TerrariumLed[] leds)
        {
            // Set up the LEDs
            _discoveryLed              = leds[(int)LedIndicators.DiscoveryWebService];
            _peerConnectionLed         = leds[(int)LedIndicators.PeerConnection];
            _receivedPeerConnectionLed = leds[(int)LedIndicators.PeerReceivedConnection];

            // Start listening on HTTP
            _peerChannel = peerChannel;
            //GlobalProxySelection.Select = GlobalProxySelection.GetEmptyWebProxy();
            WebRequest.DefaultWebProxy = null;
            SetHostIPInformation();
            StartHttpNamespaceManager();

            // Start our announcement thread
            announceThread = new Thread(AnnounceAndRegisterPeer)
            {
                Name = "Peer Discovery Thread"
            };
            announceThread.Start();
        }
Esempio n. 4
0
        private DataTable _totalsTable; // One row per tick, One row per species, current population, min and max

        /// <summary>
        ///  Creates a new PopulationData class that can be used to report data and
        ///  update a status LED.
        /// </summary>
        /// <param name="reportData">Should data be reported to the server.</param>
        /// <param name="led">An LED used to indicate status.</param>
        public PopulationData(bool reportData, TerrariumLed led)
        {
            _reportDataToServer = reportData;
            _led = led;
            ResetData();
        }