public static JObject SyncJsonRequest(string act, JObject header, JObject payload) { Logger.LogInfo("REQ {0} {1} {2}", act, JSON.Stringify(header), JSON.Stringify(payload)); using (var e = new ManualResetEvent(false)) { JObject result = null; RPCException exn = null; MakeJsonRequest(ActionName.Parse(act), header, payload, (ex, res) => { exn = ex; result = res; e.Set(); }); e.WaitOne(); Logger.LogInfo("RES {0} {1}", exn, JSON.Stringify(result)); if (exn != null) { throw exn; } return(result); } }