using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using SMWebServer; using Sog; namespace SMWebServer { public class Program { public static SyncHttpServerService m_httpService = new SyncHttpServerService(); public static void Main(string[] args) { long iNow = DateTimeOffset.Now.ToUnixTimeSeconds(); bool bServerRunMode = false; try { AppParam appParam = new AppParam(args,true); if(appParam.RunMode == AppRunMode.Start) { bServerRunMode = true; } SMWebServerApp entry = new SMWebServerApp(appParam); entry.Start(m_httpService); } catch (Exception ex) { if(bServerRunMode) { TraceLog.Exception(ex,true); } else { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } } } } }