Esempio n. 1
0
        static void Main(string[] args)
        {
            var webServer = new SimpleHttpServer("c:\\simpleWeb", 9050);

            //webServer.
            Console.WriteLine("Hosting c:\\simpleWeb on port 9050");
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
Esempio n. 2
0
        /// <summary>
        /// Internal method that instantiates the server instance
        /// </summary>
        /// <param name="parms"></param>
        private static void StartHttpServerThread(object parms)
        {
            if (Current != null)
            {
                StopHttpServerOnThread();
            }

            var httpParms = parms as ServerStartParameters;

            Current = new SimpleHttpServer(httpParms.Path, httpParms.Port);
            Current.RequestHandler = httpParms.RequestHandler;
        }
Esempio n. 3
0
 /// <summary>
 /// Call this method to stop the Singleton instance of the server.
 /// </summary>
 public static void StopHttpServerOnThread()
 {
     Current.Stop();
     Current = null;
 }