public void request(string route, JsonObject msg, Action <JsonObject> action) { this.eventManager.AddCallBack(reqId, action); protocol.send(route, reqId, msg); reqId++; }
public void request(JsonObject user, Action <JsonObject> callback) { byte[] body = Encoding.UTF8.GetBytes(buildMsg(user).ToString()); protocol.send(PackageType.PKG_HANDSHAKE, body); this.callback = callback; }
public void sendHeartBeat(object source, ElapsedEventArgs e) { TimeSpan span = DateTime.Now - lastTime; timeout = (int)span.TotalMilliseconds; //check timeout if (timeout > interval * 2) { protocol.getPomeloClient().disconnect(); //stop(); return; } //Send heart beat protocol.send(PackageType.PKG_HEARTBEAT); }