       @_schedule_reconnect(2000)
 
   _on_error : (reject) ->
-    logger.debug("Websocket error")
+    logger.debug("Websocket error on socket  #{@_number}")
     reject(new Error("Could not open websocket"))
 
   _close_bad_protocol : (detail) ->

      logger.error("Failed to repull session #{error}")

  _on_open : (resolve, reject) ->
    logger.debug("Websocket connection is now open")
    @_pending_ack = [resolve, reject]
    @_current_handler = (message) =>
      @_awaiting_ack_handler(message)


  close : () ->
    if not @closed_permanently
      logger.debug("Permanently closing websocket connection #{@_number}")
      @closed_permanently = true
      if @socket?
        @socket.close(1000, "close method called on ClientConnection #{@_number}")
      @_for_session (session) ->
        session._connection_closed()
      if @_on_closed_permanently_hook?
