| 341 | } |
| 342 | |
| 343 | int SocketMap::Find(const SocketMapKey& key, SocketId* id) { |
| 344 | BAIDU_SCOPED_LOCK(_mutex); |
| 345 | SingleConnection* sc = _map.seek(key); |
| 346 | if (sc) { |
| 347 | *id = sc->socket->id(); |
| 348 | return 0; |
| 349 | } |
| 350 | return -1; |
| 351 | } |
| 352 | |
| 353 | void SocketMap::List(std::vector<SocketId>* ids) { |
| 354 | ids->clear(); |
no test coverage detected