       url  = "ws://#{host}:#{port}/socket.io/websocket"
       @ws = new WebSocket(url)
       @ws.onmessage = @onMessage.bind(@)
-      @ws.onerror = @onError.bind(@)
+      @ws.onerror = @disconnect.bind(@)
       @ws.onclose = @onClose.bind(@)
 
   whichServer: (roomid, callback) ->

          callback.call(@, host, port)
        else
          @log "Failed to determine which server to use: #{dataStr}"
          @onError new Error 'Error parsing server response'
    .on 'error', (e) =>
      @log "whichServer error: #{e}"
      @onError e


  setTmpSong: (data) ->

    else
      activity = @lastActivity
    if @_isConnected and (Date.now() - activity) > @disconnectInterval
      @log 'No response from server; is there a proxy/firewall problem?'
      @disconnect new Error 'No response from server'
    else
      @updatePresence()

