コード例 #1
0
ファイル: Server.cpp プロジェクト: ChinmayJindal/GossipBox
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;
	}
}
コード例 #2
0
ファイル: note.cpp プロジェクト: dwkimm01/nclone
 void close(const std::string &connection)
 {
     p_connections.erase(connection);
 }
コード例 #3
0
ファイル: tcp.hpp プロジェクト: AnnikaH/IncludeOS
 /**
  * @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());
 }