本文整理汇总了C++中ConnMap_t::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ConnMap_t::end方法的具体用法?C++ ConnMap_t::end怎么用?C++ ConnMap_t::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConnMap_t
的用法示例。
在下文中一共展示了ConnMap_t::end方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _HandleFriendStatusNotify
void CRouteConn::_HandleFriendStatusNotify(CImPduFriendStatusNotify* pPdu)
{
uint32_t from_user_id = pPdu->GetFromUserId();
uint32_t from_user_status = pPdu->GetFromUserStatus();
uint32_t friend_cnt = pPdu->GetFriendCnt();
log("HandleFriendNotify, from_id=%u, status=%u, friend_cnt=%u\n", from_user_id, from_user_status,
friend_cnt);
if (from_user_status == USER_STATUS_OFFLINE) {
UserStatMap_t::iterator it = g_rs_user_map.find(from_user_id);
if (it != g_rs_user_map.end()) {
uint32_t status = it->second.status;
if (status != USER_STATUS_OFFLINE) {
// user is still online, do not send status leave status to other
return;
}
}
}
for (ConnMap_t::iterator it = g_route_conn_map.begin(); it != g_route_conn_map.end(); it++) {
CRouteConn* pConn = (CRouteConn*)it->second;
if (pConn) {
pConn->SendPdu(pPdu);
}
}
}
示例2: FileClientConnTimerCallback
void FileClientConnTimerCallback(void* callback_data, uint8_t msg, uint32_t handle, void* pParam) {
uint64_t cur_time = get_tick_count();
for (ConnMap_t::iterator it = g_file_client_conn_map.begin(); it != g_file_client_conn_map.end(); ) {
ConnMap_t::iterator it_old = it;
it++;
FileClientConn* conn = (FileClientConn*)it_old->second;
conn->OnTimer(cur_time);
}
}
示例3: _BroadcastMsg
void CRouteConn::_BroadcastMsg(CImPdu* pPdu, CRouteConn* pFromConn)
{
ConnMap_t::iterator it;
for (it = g_route_conn_map.begin(); it != g_route_conn_map.end(); it++) {
CRouteConn* pRouteConn = (CRouteConn*)it->second;
if (pRouteConn != pFromConn) {
pRouteConn->SendPdu(pPdu);
}
}
}
示例4: login_conn_timer_callback
void login_conn_timer_callback(void* callback_data, uint8_t msg, uint32_t handle, void* pParam)
{
uint64_t cur_time = get_tick_count();
for (ConnMap_t::iterator it = g_client_conn_map.begin(); it != g_client_conn_map.end(); ) {
ConnMap_t::iterator it_old = it;
it++;
CLoginConn* pConn = (CLoginConn*)it_old->second;
pConn->OnTimer(cur_time);
}
for (ConnMap_t::iterator it = g_msg_serv_conn_map.begin(); it != g_msg_serv_conn_map.end(); ) {
ConnMap_t::iterator it_old = it;
it++;
CLoginConn* pConn = (CLoginConn*)it_old->second;
pConn->OnTimer(cur_time);
}
}
示例5: login_conn_timer_callback
//每隔一秒,这个函数就会被调用一次
void login_conn_timer_callback(void* callback_data, uint8_t msg, uint32_t handle, void* pParam)
{
log("enter[%s]", __FUNCTION__);
//两个conn_map里所有的连接都要调用一次OnTimer()
uint64_t cur_time = get_tick_count();
for (ConnMap_t::iterator it = g_client_conn_map.begin(); it != g_client_conn_map.end(); ) {
ConnMap_t::iterator it_old = it;
it++;
CLoginConn* pConn = (CLoginConn*)it_old->second;
pConn->OnTimer(cur_time);
}
for (ConnMap_t::iterator it = g_msg_serv_conn_map.begin(); it != g_msg_serv_conn_map.end(); ) {
ConnMap_t::iterator it_old = it;
it++;
CLoginConn* pConn = (CLoginConn*)it_old->second;
pConn->OnTimer(cur_time);
}
log("leave[%s]", __FUNCTION__);
}
示例6: route_server_conn_timer_callback
void route_server_conn_timer_callback(void* callback_data, uint8_t msg, uint32_t handle, void* pParam)
{
ConnMap_t::iterator it_old;
CRouteServConn* pConn = NULL;
uint64_t cur_time = get_tick_count();
for (ConnMap_t::iterator it = g_route_server_conn_map.begin(); it != g_route_server_conn_map.end(); ) {
it_old = it;
it++;
pConn = (CRouteServConn*)it_old->second;
pConn->OnTimer(cur_time);
}
// reconnect RouteServer
serv_check_reconnect<CRouteServConn>(g_route_server_list, g_route_server_count);
}
示例7: db_server_conn_timer_callback
static void db_server_conn_timer_callback(void* callback_data, uint8_t msg, uint32_t handle, void* pParam)
{
ConnMap_t::iterator it_old;
CDBServConn* pConn = NULL;
uint64_t cur_time = get_tick_count();
for (ConnMap_t::iterator it = g_db_server_conn_map.begin(); it != g_db_server_conn_map.end(); ) {
it_old = it;
it++;
pConn = (CDBServConn*)it_old->second;
if (pConn->IsOpen()) {
pConn->OnTimer(cur_time);
}
}
// reconnect DB Storage Server
// will reconnect in 4s, 8s, 16s, 32s, 64s, 4s 8s ...
serv_check_reconnect<CDBServConn>(g_db_server_list, g_db_server_count);
}