Esempio n. 1
0
        void SendLogHandler(object sender, DataReceivedEventArgs args)
        {
            string msg = null;

            try
            {
                msg = args.Data;
            }
            catch { }

            if (msg == null)
            {
                return;
            }

            luaApis.SendLog(msg);
        }
Esempio n. 2
0
        DataReceivedEventHandler CreateSendLogHandler(Encoding encoding)
        {
            var ec = encoding;

            return((s, a) =>
            {
                try
                {
                    string msg = null;
                    var bin = Encoding.Default.GetBytes(a.Data);
                    msg = ec.GetString(bin);
                    if (!string.IsNullOrEmpty(msg))
                    {
                        luaApis?.SendLog(msg);
                    }
                }
                catch { }
            });
        }
Esempio n. 3
0
 public VgcApis.Interfaces.Lua.IRunnable CreateHttpServer(
     string url,
     VgcApis.Interfaces.Lua.ILuaMailBox inbox,
     VgcApis.Interfaces.Lua.ILuaMailBox outbox)
 {
     try
     {
         var serv = new SysCmpos.HttpServer(url, inbox, outbox);
         lock (httpServs)
         {
             httpServs.Add(serv);
         }
         return(serv);
     }
     catch (Exception ex)
     {
         luaApis.SendLog(ex.ToString());
         throw;
     }
 }