Otter SDK Reference
Version:

InvokeMethodAsync(IRemoteMethodExecuter agent, System.Delegate method, object[] parameters) Method

Invokes the method on the remote server using the specified arguments, and returns the result.

Syntax

public static Task<object> InvokeMethodAsync(IRemoteMethodExecuter agent, System.Delegate method, object[] parameters)

Parameters

agent
Type: IRemoteMethodExecuter

The agent to invoke the method on.

method
Type: System.Delegate

The method to invoke.

parameters
Type: object[]

The parameters to pass to the method. May be null (Nothing in Visual Basic) if there are no parameters.

Returns

Return value of the method if applicable; otherwise null (Nothing in Visual Basic).

Exceptions

System.ArgumentNullException

agent or method is null (Nothing in Visual Basic).

System.ArgumentException

method is not valid or parameters are not valid. See Remarks.

Remarks

The method supplied in method must refer to a single static method or a single instance method of a serializable class. The values in parameters must correspond to the arguments types of the specified method. If the remote method throws an unhandled exception, the exception will be rethrown at the client.