source关闭时, 关闭网络连接

This commit is contained in:
yangjiechina
2024-06-22 16:25:27 +08:00
parent e61bf2b23d
commit e88c243efa

View File

@@ -255,7 +255,7 @@ func (s *PublishSource) LoopEvent() {
if err := s.inputCB(data); err != nil {
log.Sugar.Errorf("处理输入流失败 释放source:%s err:%s", s.Id_, err.Error())
s.Close()
s.doClose()
}
break
case sink := <-s.playingEventQueue:
@@ -439,6 +439,10 @@ func (s *PublishSource) doClose() {
return
}
if s.Conn != nil {
s.Conn.Close()
}
//清空未写完的buffer
for _, buffer := range s.pktBuffers {
if buffer != nil {