MCPcopy
hub / github.com/q191201771/lal / CtrlKickSession

Method CtrlKickSession

pkg/logic/server_manager__api.go:117–136  ·  view source on GitHub ↗

CtrlKickSession TODO(chef): refactor 不要返回http结果,返回error吧

(info base.ApiCtrlKickSessionReq)

Source from the content-addressed store, hash-verified

115//
116// TODO(chef): refactor 不要返回http结果,返回error吧
117func (sm *ServerManager) CtrlKickSession(info base.ApiCtrlKickSessionReq) (ret base.ApiCtrlKickSessionResp) {
118 sm.mutex.Lock()
119 defer sm.mutex.Unlock()
120 g := sm.getGroup("", info.StreamName)
121 if g == nil {
122 ret.ErrorCode = base.ErrorCodeGroupNotFound
123 ret.Desp = base.DespGroupNotFound
124 return
125 }
126
127 if !g.KickSession(info.SessionId) {
128 ret.ErrorCode = base.ErrorCodeSessionNotFound
129 ret.Desp = base.DespSessionNotFound
130 return
131 }
132
133 ret.ErrorCode = base.ErrorCodeSucc
134 ret.Desp = base.DespSucc
135 return
136}
137
138func (sm *ServerManager) CtrlStartRtpPub(info base.ApiCtrlStartRtpPubReq) (ret base.ApiCtrlStartRtpPubResp) {
139 sm.mutex.Lock()

Callers

nothing calls this directly

Calls 2

getGroupMethod · 0.95
KickSessionMethod · 0.80

Tested by

no test coverage detected