Esempio n. 1
0
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;
	}
}
Esempio n. 2
0
 void close(const std::string &connection)
 {
     p_connections.erase(connection);
 }
Esempio n. 3
0
 /**
  * @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());
 }