Beispiel #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();
        }
Beispiel #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;
        }
Beispiel #3
0
 /// <summary>
 /// Call this method to stop the Singleton instance of the server.
 /// </summary>
 public static void StopHttpServerOnThread()
 {
     Current.Stop();
     Current = null;
 }