1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-24 20:35:59 +00:00

Nothing special here

On websocket:
https://github.com/kataras/iris/issues/340#issuecomment-237612680
This commit is contained in:
Gerasimos Maropoulos
2016-08-04 19:49:12 +03:00
parent 922248bbf1
commit 2b364817c3
3 changed files with 16 additions and 2 deletions

View File

@@ -201,7 +201,9 @@ func (s *websocketServer) serve() {
case join := <-s.join:
s.joinRoom(join.roomName, join.websocketConnectionID)
case leave := <-s.leave:
s.leaveRoom(leave.roomName, leave.websocketConnectionID)
if _, found := s.websocketConnections[leave.websocketConnectionID]; found {
s.leaveRoom(leave.roomName, leave.websocketConnectionID)
}
case msg := <-s.messages: // message received from the websocketConnection
if msg.to != All && msg.to != NotMe && s.rooms[msg.to] != nil {
// it suppose to send the message to a room