def on_close(code, reason)
      connection.terminate
      terminate
      log_debug("#{@actor.class} dispatching on close  #{code} #{reason}")
      if @actor.respond_to?(:async)
        @actor.async.on_close(code, reason)
      else
        @actor.on_close(code, reason)
      end
    end
def on_close(code, reason)
      connection.terminate
      terminate
      log_debug("#{@actor.class} dispatching on close  #{code} #{reason}")
      if @actor.respond_to?(:async)
        @actor.async.on_close(code, reason)
      else
        @actor.on_close(code, reason)
      end
    end
callback executes when connection closes

 @param [String] code

 @param [String] reason

 @return [void]

 @api public