feat: 接线 serve 真实 auth/注册/管理/MQTT 与消息循环
This commit is contained in:
@@ -67,6 +67,17 @@ func (c *MemoryConns) Current(endpointID string) (LiveConn, bool) {
|
||||
return v, ok
|
||||
}
|
||||
|
||||
// Snapshot 返回当前连接表副本(供推送循环遍历)。
|
||||
func (c *MemoryConns) Snapshot() map[string]LiveConn {
|
||||
c.mu.RLock()
|
||||
defer c.mu.RUnlock()
|
||||
out := make(map[string]LiveConn, len(c.m))
|
||||
for k, v := range c.m {
|
||||
out[k] = v
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// RecordingDownlink 记录下行发布,供测试断言。
|
||||
type RecordingDownlink struct {
|
||||
mu sync.Mutex
|
||||
|
||||
Reference in New Issue
Block a user