Exemple #1
0
bool protocolManagerNetworkedProtocolsFilter(BaseProtocol *pProtocol) {
  IOHandler *pIOHandler = pProtocol->GetIOHandler();
  if ((pIOHandler == NULL)
      || ((pIOHandler->GetType() != IOHT_TCP_CARRIER)
      && (pIOHandler->GetType() != IOHT_UDP_CARRIER)))
    return false;
  return true;
}
Exemple #2
0
void ProtocolManager::GetNetworkedProtocols(map<uint32_t, BaseProtocol *> &result) {
    result.clear();
    FOR_MAP(_activeProtocols, uint32_t, BaseProtocol *, i) {
        BaseProtocol *pProtocol = MAP_VAL(i)->GetNearEndpoint();
        if (MAP_HAS1(result, pProtocol->GetId()))
            continue;
        IOHandler *pIOHandler = pProtocol->GetIOHandler();
        if ((pIOHandler == NULL)
                || ((pIOHandler->GetType() != IOHT_TCP_CARRIER)
                    && (pIOHandler->GetType() != IOHT_UDP_CARRIER)))
            continue;
        result[pProtocol->GetId()] = pProtocol;
    }