Example #1
0
        // -----------------------------------------------------------------
        /// <summary>
        /// all of the shared modules have been loaded and initialized
        /// </summary>
        // -----------------------------------------------------------------
        public void PostInitialise()
        {
            if (m_enabled)
            {
                m_commands.RegionsLoaded();

                // Start the listener thread here
                //Watchdog.StartThread(AsynchronousListenLoop,"Dispatcher",ThreadPriority.Normal,false,true,null,4*m_socketTimeout);
                WorkManager.StartThread(AsynchronousListenLoop, "Dispatcher", ThreadPriority.Normal, false, true, null, 4 * m_socketTimeout);

                // Add a handler to the HTTP server
                // MainServer.Instance.AddHTTPHandler(m_httppath,HandleSynchronousRequest);

                DispatcherStreamHandler handler = new DispatcherStreamHandler("POST", m_httppath, HandleStreamRequest);
                MainServer.Instance.AddStreamHandler(handler);

                // Start the timeout thread
                m_endpointTimer = new System.Timers.Timer(m_maxInterPingTime / 4);

                m_endpointTimer.Enabled   = true;
                m_endpointTimer.AutoReset = true;
                m_endpointTimer.Interval  = m_maxInterPingTime / 4;
                m_endpointTimer.Elapsed  += new ElapsedEventHandler(CheckEndPointTimeout);
            }
        }
        // -----------------------------------------------------------------
        /// <summary>
        /// all of the shared modules have been loaded and initialized
        /// </summary>
        // -----------------------------------------------------------------
        public void PostInitialise()
        {
            if (m_enabled)
            {
                m_commands.RegionsLoaded();

                // Start the listener thread here
                //Watchdog.StartThread(AsynchronousListenLoop,"Dispatcher",ThreadPriority.Normal,false,true,null,4*m_socketTimeout);
                WorkManager.StartThread(AsynchronousListenLoop,"Dispatcher",ThreadPriority.Normal,false,true,null,4*m_socketTimeout);

                // Add a handler to the HTTP server
                // MainServer.Instance.AddHTTPHandler(m_httppath,HandleSynchronousRequest);

                DispatcherStreamHandler handler = new DispatcherStreamHandler("POST", m_httppath, HandleStreamRequest);
                MainServer.Instance.AddStreamHandler(handler);

                // Start the timeout thread
                m_endpointTimer = new System.Timers.Timer(m_maxInterPingTime/4);

                m_endpointTimer.Enabled = true;
                m_endpointTimer.AutoReset = true;
                m_endpointTimer.Interval = m_maxInterPingTime/4;
                m_endpointTimer.Elapsed += new ElapsedEventHandler(CheckEndPointTimeout);
            }
        }