MM-10375 Fixing connected socket count (#8682)

* Fixing connected socket count

* Adding unit test
Этот коммит содержится в:
Corey Hulen
2018-04-27 10:38:40 -07:00
коммит произвёл Christopher Speller
родитель 7abd6176e9
Коммит 2acbc77d78
2 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@@ -378,6 +378,7 @@ func (h *Hub) Start() {
atomic.StoreInt64(&h.connectionCount, int64(len(connections.All())))
case webCon := <-h.unregister:
connections.Remove(webCon)
atomic.StoreInt64(&h.connectionCount, int64(len(connections.All())))
if len(webCon.UserId) == 0 {
continue