Beispiel #1
0
CBaseSocket* FindBaseSocket(net_handle_t fd)
{
    CBaseSocket* pSocket = NULL;
    SocketMap::iterator iter = g_socket_map.find(fd);
    if (iter != g_socket_map.end())
    {
        pSocket = iter->second;
        pSocket->AddRef();
    }
    
    return pSocket;
}
Beispiel #2
0
void AddBaseSocket(CBaseSocket* pSocket)
{
    g_socket_map.insert(make_pair((net_handle_t)pSocket->GetSocket(), pSocket));
    printf("a new client connected,total connection = %d\n", g_socket_map.size());
}
Beispiel #3
0
void RemoveBaseSocket(CBaseSocket* pSocket)
{
    g_socket_map.erase((net_handle_t)pSocket->GetSocket());
}
Beispiel #4
0
void AddBaseSocket(CBaseSocket* pSocket)
{
	g_socket_map.insert(make_pair((net_handle_t)pSocket->GetSocket(), pSocket));
}