         clientToSendId  = args[2]
 
         console.log(eventName)
-        sock = room[clientToSendId]
+        sock = room[roomId][clientToSendId]
         if sock?
           args[1] = socket.clientId
 

              console.log(error))
      else
        if eventName == 'authentification'
          clientId  = args[2]

          console.log "Authentification"

          if roomValidation?
            console.log "Room" + roomId + " is valid"
            datas = getClientDatas(clientId)
            if datas?
              socket.roomId   = roomId
              socket.clientId = clientId

              rooms[roomId] = socket
              socket.enable = true
            else
              socket.close()
          else

  socket.on('close', () ->
    if socket.enable == true
      if socket.roomId != -1 && rooms[socket.roomId]
        rooms[socket.roomId][socket.clientId] = null
    sockets.splice(sockets.indexOf(socket), 1)
    console.log('close')
    )
