void ASyncEventCallBack::onManagerEvent(const ManagerEvent& me) { LOG_TRACE_STR("ASyncEventCallBack :" + me.toLog()); if (function != NULL) { (function) (me); } LOG_TRACE_STR("OUT"); }
ManagerResponse* ManagerConnection::syncSendAction(ManagerAction& action, unsigned int timeout) { LOG_TRACE_STR("IN"); SyncResponseCallBack srcb(&action, timeout); addResponsetListener(action.generateID(), &srcb); send(action.toString()); srcb.stoll(); return (srcb.response); }
void ManagerConnection::dispatchEvent(const std::string& event) { LOG_TRACE_STR(str2Log(event)); ManagerEvent *me = this->eventBuilder.buildEvent(event); if (me != NULL) { this->fireEvent(*me); } delete (me); }
void ManagerConnection::dispatchResponse(const std::string& response) { LOG_TRACE_STR(str2Log(response)); ManagerAction *action = NULL; std::string actionId = extractActionID(response); if (!actionId.empty()) { ResponseCallBack *cb = ManagerResponsesHandler::listeners[actionId]; if (cb != NULL) { action = cb->getAction(); } } this->fireResponseCallback(this->responseBuilder.buildResponse(action, response)); }
void ManagerConnection::send(const std::string& data) { LOG_DEBUG_STR(str2Log(data)); this->socket->writeData(data); LOG_TRACE_STR("OUT"); }
void ManagerConnection::send(const std::string& data) { LOG_DEBUG_STR(str2Log(data)); this->socket->writeData(data.c_str(), (unsigned int) (data.length())); LOG_TRACE_STR("OUT"); }