void PushService::onPing() { g_sm->checkCurrentOn(ServiceMgr::PUSH); BfPingData data; data.set_message("ctpgateway"); for (auto client : clients_) { client->OnPing(data); } }
void PushService::onPing() { g_sm->checkCurrentOn(ServiceMgr::PUSH); //google::protobuf::Arena arena; //BfPingData* data = google::protobuf::Arena::CreateMessage<BfPingData>(&arena); //data->set_message("bftrader"); //for (auto proxy : proxyClients_) { // proxy->OnPing(*data); //} BfPingData data; data.set_message("bftrader"); for (auto proxy : proxyClients_) { proxy->OnPing(data); } }
void DbService::onPing() { //BfLog(__FUNCTION__); g_sm->checkCurrentOn(ServiceMgr::PUSH); if (client_) { // ping datafeed BfPingData req; req.set_message(client_->clientId().toStdString()); bool ok = client_->Ping(req); // ready是没必要的,用ping检测最好= if (ok || client_->ready()) { } } }