We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
s.ws.Range(func(key, val interface{}) bool { v := val.(*PackWriterCloser) fmt.Printf(key.(string) + "\n") if !v.init { if err = s.cache.Send(v.w); err != nil { log.Debugf("[%s] send cache packet error: %v, remove", v.w.Info(), err) s.ws.Delete(key) return true } fmt.Printf("key:%v, value:%v", key, val) v.init = true } else { newPacket := p if err = v.w.Write(&newPacket); err != nil { log.Debugf("[%s] write packet error: %v, remove", v.w.Info(), err) s.ws.Delete(key) } } return true }) 上述代码遍历了某个推流stream下的ws(sync.map),循环向每个想要拉流的tcp连接写入av.Packet,如此一来在连接数很多时是否会导致效率极低,甚至影响推流写入cache的速度,在多人直播间中应该如何优化呢,也可能是本人理解错误了,希望大佬帮忙回答下,感谢
The text was updated successfully, but these errors were encountered:
No branches or pull requests
s.ws.Range(func(key, val interface{}) bool {
v := val.(*PackWriterCloser)
fmt.Printf(key.(string) + "\n")
if !v.init {
if err = s.cache.Send(v.w); err != nil {
log.Debugf("[%s] send cache packet error: %v, remove", v.w.Info(), err)
s.ws.Delete(key)
return true
}
fmt.Printf("key:%v, value:%v", key, val)
v.init = true
} else {
newPacket := p
if err = v.w.Write(&newPacket); err != nil {
log.Debugf("[%s] write packet error: %v, remove", v.w.Info(), err)
s.ws.Delete(key)
}
}
return true
})
上述代码遍历了某个推流stream下的ws(sync.map),循环向每个想要拉流的tcp连接写入av.Packet,如此一来在连接数很多时是否会导致效率极低,甚至影响推流写入cache的速度,在多人直播间中应该如何优化呢,也可能是本人理解错误了,希望大佬帮忙回答下,感谢
The text was updated successfully, but these errors were encountered: