void RhsListener::RemoveAllListeners(Connection* pConnection) { // We need to walk the list of all rhs functions, removing this connection for (RhsMapIter mapIter = m_RhsMap.begin() ; mapIter != m_RhsMap.end() ; mapIter++) { std::string function = mapIter->first ; ConnectionList* pList = mapIter->second ; pList->remove(pConnection) ; } }
// Start listening for a specific RHS user function. When it fires we'll call to the client // (over the connection) to implement it. void RhsListener::RemoveRhsListener(char const* pFunctionName, Connection* pConnection) { ConnectionList* pList = GetRhsListeners(pFunctionName) ; // We have no record of anyone listening for this event // That's not an error -- it's OK to call this for all events in turn // to make sure a connection is removed completely. if (pList == NULL || pList->size() == 0) return ; pList->remove(pConnection) ; }