       false
 
   open: =>
-    if @webSocket and not @isState("closed")
+    if @webSocket and not @isClosed()
       console.log("[cable] Attemped to open WebSocket, but existing socket is #{@getState()}", Date.now())
       throw new Error("Existing connection must be closed before opening")
     else
-      console.log("[cable] Opening WebSocket", Date.now())
+      console.log("[cable] Opening WebSocket, current state is #{@getState()}", Date.now())
       @webSocket = new WebSocket(@consumer.url)
       @installEventHandlers()
       true

    @isState("open")

  # Private

  isState: (states...) ->
    @getState() in states


  reopen: ->
    console.log("[cable] Reopening WebSocket, current state is #{@getState()}", Date.now())
    if @isClosed()
      @open()
    else
      try
