增加关闭hub
This commit is contained in:
@@ -75,6 +75,10 @@ func (s *Server) Start() {
|
||||
go s.hub.Run()
|
||||
}
|
||||
|
||||
func (s *Server) Stop() {
|
||||
s.hub.Close()
|
||||
}
|
||||
|
||||
// readPump 从WebSocket连接读取消息
|
||||
func (c *Client) readPump() {
|
||||
defer func() {
|
||||
|
||||
Reference in New Issue
Block a user