|
|
@ -26,6 +26,7 @@ static long long MONITOR_TIMEOUT = 5000;
|
|
|
|
const unsigned int DEF_DATA_SIZE = 188*7;
|
|
|
|
const unsigned int DEF_DATA_SIZE = 188*7;
|
|
|
|
const long long CHECK_ALIVE_INTERVAL = 5*1000;
|
|
|
|
const long long CHECK_ALIVE_INTERVAL = 5*1000;
|
|
|
|
const long long CHECK_ALIVE_TIMEOUT = 5*1000;
|
|
|
|
const long long CHECK_ALIVE_TIMEOUT = 5*1000;
|
|
|
|
|
|
|
|
static const int SRT_WRTIE_FAIL_MAX = 10;
|
|
|
|
|
|
|
|
|
|
|
|
long long srt_now_ms = 0;
|
|
|
|
long long srt_now_ms = 0;
|
|
|
|
|
|
|
|
|
|
|
@ -215,6 +216,7 @@ void srt_handle::handle_push_data(SRT_SOCKSTATUS status, const std::string& subp
|
|
|
|
srt_log_info("receive data size(%d) from pusher(%d) to pullers, count:%d",
|
|
|
|
srt_log_info("receive data size(%d) from pusher(%d) to pullers, count:%d",
|
|
|
|
ret, conn_fd, streamid_iter->second.size());
|
|
|
|
ret, conn_fd, streamid_iter->second.size());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<SRTSOCKET> remove_vec;
|
|
|
|
for (auto puller_iter = streamid_iter->second.begin();
|
|
|
|
for (auto puller_iter = streamid_iter->second.begin();
|
|
|
|
puller_iter != streamid_iter->second.end();
|
|
|
|
puller_iter != streamid_iter->second.end();
|
|
|
|
puller_iter++) {
|
|
|
|
puller_iter++) {
|
|
|
@ -227,6 +229,17 @@ void srt_handle::handle_push_data(SRT_SOCKSTATUS status, const std::string& subp
|
|
|
|
srt_log_info("send data size(%d) to puller fd:%d", write_ret, puller_iter->first);
|
|
|
|
srt_log_info("send data size(%d) to puller fd:%d", write_ret, puller_iter->first);
|
|
|
|
if (write_ret > 0) {
|
|
|
|
if (write_ret > 0) {
|
|
|
|
puller_iter->second->update_timestamp(srt_now_ms);
|
|
|
|
puller_iter->second->update_timestamp(srt_now_ms);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (player_conn->get_write_fail_count() > SRT_WRTIE_FAIL_MAX) {
|
|
|
|
|
|
|
|
remove_vec.push_back(puller_iter->first);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (auto item : remove_vec) {
|
|
|
|
|
|
|
|
streamid_iter->second.erase(item);
|
|
|
|
|
|
|
|
if (streamid_iter->second.empty()) {
|
|
|
|
|
|
|
|
_streamid_map.erase(streamid_iter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|