// JRTPLIB 3.11.1, file path : JRTPLIB / src / rtptcptransmitter.cpp, line 292 - 317
// RTPSession::DeleteDestination(RTPTCPAddress(sock_with_no_data_readable))
// manually delete the fd with no data readable from the m_destSockets queue lead to sys cpu reduce to low rate!
// from line 280 - 324, JRTPLIB / src / rtptcptransmitter.cpp
std::map<SocketType, SocketData>::iterator it = m_destSockets.begin();
std::map<SocketType, SocketData>::iterator end = m_destSockets.end();
status = PollSocket(sock, it->second);
我希望找到更好的解决方案以降低cpu占用率!
为什么遍历所有fd而不是具有可读数据的fd?使用“遍历所有fd”策略将导致以下问题。当m_destSockets队列中有大量无法读取数据的fd时,sys CPU占用率将达到100%。