public static void V_VNA(NetwRunnable nr, ExecHm rc, Bys m, out string name, out IDictionary<string, Object> args) { var res = new Dict(m.V<Dictionary<string, object>>()); name = res.Val("name", ""); var obj = res["args"]; args = res["args"] as IDictionary<string,object>; }
public void onCon(NetwRunnable nr, Netw w) { if (this.OnCon != null) { this.OnCon(nr, w); } }
public void onErr(NetwRunnable nr, Exception e) { if (this.OnErr != null) { this.OnErr(nr, e); } }
public void begCon(NetwRunnable nr) { if (this.BegCon != null) { this.BegCon(nr); } }
public void endCon(NetwRunnable nr) { if (this.EndCon != null) { this.EndCon(nr); } }
public virtual void onCmd(NetwRunnable nr, Bys m) { foreach (CmdListener ml in this.qs) { ml.onCmd(nr, m); } }
public void onCmd(NetwRunnable nr, Bys m) { if (m.length < 3) { L.W("RC_S receive the command data less 3:" + m.toBs()); return; } var pref = m.slice(0, 3); m.forward(3); this.H.onCmd(nr, m.newM(new PrefC(m, pref), m.bys, m.offset, m.length)); }
public void onCmd(NetwRunnable nr, Bys m) { try { string name; IDictionary<string, Object> args; this.vna(nr, this, m, out name, out args); var rc = new RCM_Cmd(m, name, args); bool next = false; foreach (var filter in this.filters) { if (!filter.Key.IsMatch(name)) { continue; } var res = filter.Value(rc, out next); if (next) { continue; } else { m.writev(res); return; } } foreach (var handler in this.handler) { if (handler.Key.IsMatch(name)) { m.writev(handler.Value(rc)); return; } } m.writev(Util.dict("err", "function not found by name:" + name)); }catch(Exception e) { L.E(e, "ExecHm exec error:{0}", e.Message); m.writev(Util.dict("err", "exec fail with " + e.Message)); } }
public virtual void onCmd(NetwRunnable nr, Bys m) { new Task(i => h.onCmd(nr, m), 0).Start(); }
public void onCmd(NetwRunnable nr, Bys m) { Console.WriteLine(val++); Thread.Sleep(300); }
public void onCmd(NetwRunnable nr, Bys m) { }
public void onCmd(NetwRunnable nr, Bys m) { Assert.AreEqual(this.val, m.get(0)); }
public void onCmd(NetwRunnable nr, Bys m) { Assert.AreEqual(this.val, this.t.val); this.t.val++; }