void removeFromConnectionTable(int socketDescriptor){ /* Remove the user with the closed socket */ Connections::iterator it = conn.begin(); while(it!=conn.end()){ if(it->second == socketDescriptor){ #ifdef __INFO__ std::cout<<"\""<<it->first<<"\" went offline on socket "<<socketDescriptor<<"."<<std::endl; #endif conn.erase(it); break; } ++it; } }
void close(const std::string &connection) { p_connections.erase(connection); }
/** * @brief Closes and deletes a connection. * * @param[in] conn A ptr to a Connection */ void close_connection(const tcp::Connection* conn) { unbind(conn->local()); connections_.erase(conn->tuple()); }