 
 # Note: All methods are synchronous (using fibers).
 class $XAPI
+  # Number of tries when the connection fails (TCP or XAPI).
+  tries: 10
 
   constructor: ({@host, @username, @password}) ->
     @connect()

        # Something went wrong.
        error = result.ErrorDescription or value
      catch error # Captures the error if it was thrown.

      # Gets the error code for transport errors and XAPI errors.
      code = error.code or error[0]


    args.unshift @sessionId if @sessionId

    tries = @tries
    do helper = =>
      try
        result = @xmlrpc.methodCall method, args
