mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-16 04:55:58 +08:00
Refine: 优化tcp/udp服务器异常管理断开机制
This commit is contained in:
@@ -45,17 +45,11 @@ RtpSession::~RtpSession() {
|
||||
}
|
||||
|
||||
void RtpSession::onRecv(const Buffer::Ptr &data) {
|
||||
try {
|
||||
if (_is_udp) {
|
||||
onRtpPacket(data->data(), data->size());
|
||||
return;
|
||||
}
|
||||
RtpSplitter::input(data->data(), data->size());
|
||||
} catch (SockException &ex) {
|
||||
shutdown(ex);
|
||||
} catch (std::exception &ex) {
|
||||
shutdown(SockException(Err_other, ex.what()));
|
||||
if (_is_udp) {
|
||||
onRtpPacket(data->data(), data->size());
|
||||
return;
|
||||
}
|
||||
RtpSplitter::input(data->data(), data->size());
|
||||
}
|
||||
|
||||
void RtpSession::onError(const SockException &err) {
|
||||
|
||||
Reference in New Issue
Block a user