本文整理汇总了C++中ConnMap_t::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ ConnMap_t::erase方法的具体用法?C++ ConnMap_t::erase怎么用?C++ ConnMap_t::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConnMap_t
的用法示例。
在下文中一共展示了ConnMap_t::erase方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Close
void CLoginConn::Close()
{
if (m_handle != NETLIB_INVALID_HANDLE)
{
netlib_close(m_handle);
if (m_conn_type == LOGIN_CONN_TYPE_CLIENT)
{
g_client_conn_map.erase(m_handle);
}
else
{
g_msg_serv_conn_map.erase(m_handle);
// remove all user count from this message server
map<uint32_t, msg_serv_info_t*>::iterator it = g_msg_serv_info.find(m_handle);
if (it != g_msg_serv_info.end())
{
msg_serv_info_t* pMsgServInfo = it->second;
g_total_online_user_cnt -= pMsgServInfo->cur_conn_cnt;
log("onclose from MsgServer: %s:%u ", pMsgServInfo->hostname.c_str(), pMsgServInfo->port);
delete pMsgServInfo;
g_msg_serv_info.erase(it);
}
}
}
ReleaseRef();
}
示例2: Close
void CRouteConn::Close()
{
if (m_handle != NETLIB_INVALID_HANDLE) {
netlib_close(m_handle);
g_route_conn_map.erase(m_handle);
}
// remove all user info from this MessageServer
UserInfoMap_t::iterator it_old;
for (UserInfoMap_t::iterator it = g_user_map.begin(); it != g_user_map.end(); )
{
it_old = it;
it++;
CUserInfo* pUser = it_old->second;
pUser->RemoveRouteConn(this);
if (pUser->GetRouteConnCount() == 0)
{
delete pUser;
pUser = NULL;
g_user_map.erase(it_old);
}
}
ReleaseRef();
}
示例3: Close
void CRouteConn::Close()
{
if (m_handle != NETLIB_INVALID_HANDLE) {
netlib_close(m_handle);
g_route_conn_map.erase(m_handle);
}
// remove all user info from this MessageServer
UserStatMap_t::iterator it_old;
for (UserStatMap_t::iterator it = g_rs_user_map.begin(); it != g_rs_user_map.end(); ) {
it_old = it;
it++;
RouteConnMap_t::iterator conn_it = it_old->second.conns.find(this);
if (conn_it != it_old->second.conns.end()) {
it_old->second.conns.erase(conn_it);
if (it_old->second.conns.empty()) {
g_rs_user_map.erase(it_old);
}
}
}
ReleaseRef();
}
示例4: Close
void ClientConn::Close()
{
log("clientconn close from handle = %d\n", m_handle);
if (m_handle != NETLIB_INVALID_HANDLE) {
netlib_close(m_handle);
g_client_conn_map.erase(m_handle);
}
ReleaseRef();
}
示例5: Close
void CDBServConn::Close()
{
// reset server information for the next connect
serv_reset<CDBServConn>(g_db_server_list, g_db_server_count, m_serv_idx);
if (m_handle != NETLIB_INVALID_HANDLE) {
netlib_close(m_handle);
g_db_server_conn_map.erase(m_handle);
}
ReleaseRef();
}
示例6: Close
void CLoginServConn::Close()
{
serv_reset<CLoginServConn>(g_login_server_list, g_login_server_count, m_serv_idx);
if (m_handle != NETLIB_INVALID_HANDLE)
{
netlib_close(m_handle);
g_login_server_conn_map.erase(m_handle);
}
ReleaseRef();
}
示例7: Close
void FileMsgServerConn::Close() {
log("Close client, handle %d", m_handle);
connected_ = false;
if (m_handle != NETLIB_INVALID_HANDLE) {
netlib_close(m_handle);
g_file_msg_server_conn_map.erase(m_handle);
}
ReleaseRef();
}
示例8: Close
void CRouteServConn::Close()
{
serv_reset<CRouteServConn>(g_route_server_list, g_route_server_count, m_serv_idx);
m_bOpen = false;
if (m_handle != NETLIB_INVALID_HANDLE) {
netlib_close(m_handle);
g_route_server_conn_map.erase(m_handle);
}
ReleaseRef();
if (g_master_rs_conn == this) {
update_master_route_serv_conn();
}
}
示例9: Close
void CFileConn::Close()
{
log("close client, handle %d", m_handle);
m_bAuth = false;
if (m_handle != NETLIB_INVALID_HANDLE) {
netlib_close(m_handle);
g_file_conn_map.erase(m_handle);
}
if (m_user_id > 0) {
g_file_user_map.erase(m_user_id);
m_user_id = 0;
}
ReleaseRef();
}
示例10: Close
void FileClientConn::Close() {
log("close client, handle %d", m_handle);
if (transfer_task_) {
if (transfer_task_->GetTransMode() == FILE_TYPE_ONLINE) {
transfer_task_->set_state(kTransferTaskStateInvalid);
// CImConn* conn = transfer_task_->GetOpponentConn(user_id_);
// if (conn) {
// FileClientConn* conn2 = reinterpret_cast<FileClientConn*>(conn);
// conn2->Close2();
// }
// Close2();
} else {
if (transfer_task_->state() >= kTransferTaskStateUploadEnd) {
transfer_task_->set_state(kTransferTaskStateWaitingDownload);
}
}
transfer_task_->SetConnByUserID(user_id_, NULL);
TransferTaskManager::GetInstance()->DeleteTransferTaskByConnClose(transfer_task_->task_id());
// 关闭另一个连接
// if (transfer_task_->GetTransMode() == FILE_TYPE_ONLINE) {
// }
transfer_task_ = NULL;
}
auth_ = false;
if (m_handle != NETLIB_INVALID_HANDLE) {
netlib_close(m_handle);
g_file_client_conn_map.erase(m_handle);
}
// if (user_id_ > 0) {
// g_file_user_map.erase(m_user_id);
// m_user_id = 0;
// }
ReleaseRef();
}