public XNetThread Send(JSON data, Action <XNetResult> cb) { JSON opt = new JSON(JSONType.Object); opt["ReadWriteTimeout"] = new JSON(this.tow); opt["Timeout"] = new JSON(this.tor); XNetThread rx = new XNetThread(u, m, h, opt); rx.Data = data; switch (o) { case XNetMode.Asynchronous: if (!rx.SendAsych(cb)) { cb(new XNetResult(false)); } break; case XNetMode.Synchronous: cb(rx.SendSynch()); break; } return(rx); }
public XNetThread Get(JSON data, Action <XNetResult> cb) { XNetThread rx = new XNetThread(u, XNetMethod.GET, h); rx.Data = data; switch (o) { case XNetMode.Asynchronous: if (!rx.SendAsych(cb)) { cb(new XNetResult(false)); } break; case XNetMode.Synchronous: cb(rx.SendSynch()); break; } return(rx); }