mirror of
https://github.com/lkmio/lkm.git
synced 2025-09-27 11:32:26 +08:00
source关闭时, 关闭网络连接
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user