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? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
崩溃的地方在main.go User.OnEvent,原因是data.(*common.DataFrame[any]).Value为nil 原代码: func (u *User) OnEvent(event any) { switch v := event.(type) { case *track.Data: u.AddTrack(v) go v.Play(u.IO, func(data any) error { u.writeLock.Lock() defer u.writeLock.Unlock() return wsutil.WriteServerText(u.Conn, data.(*common.DataFrame[any]).Value.([]byte)) }) default: u.Subscriber.OnEvent(event) } } 修改代码: 在defer u.writeLock.Unlock()下面增加: if data.(*common.DataFrame[any]).Value == nil { return nil }
func (u *User) OnEvent(event any) { switch v := event.(type) { case *track.Data: u.AddTrack(v) go v.Play(u.IO, func(data any) error { u.writeLock.Lock() defer u.writeLock.Unlock() return wsutil.WriteServerText(u.Conn, data.(*common.DataFrame[any]).Value.([]byte)) }) default: u.Subscriber.OnEvent(event) } }
if data.(*common.DataFrame[any]).Value == nil { return nil }
The text was updated successfully, but these errors were encountered:
嗯,在Play里面缺少了判断ring被销毁的条件了
Sorry, something went wrong.
@saner-qu 求问您客户端用的什么?自己开发的吗?
No branches or pull requests
崩溃的地方在main.go User.OnEvent,原因是data.(*common.DataFrame[any]).Value为nil
原代码:
func (u *User) OnEvent(event any) { switch v := event.(type) { case *track.Data: u.AddTrack(v) go v.Play(u.IO, func(data any) error { u.writeLock.Lock() defer u.writeLock.Unlock() return wsutil.WriteServerText(u.Conn, data.(*common.DataFrame[any]).Value.([]byte)) }) default: u.Subscriber.OnEvent(event) } }
修改代码:
在defer u.writeLock.Unlock()下面增加:
if data.(*common.DataFrame[any]).Value == nil { return nil }
The text was updated successfully, but these errors were encountered: