Class RpcClientFactory

Creates remote API connections.

Inheritance
Object
Solti.Utils.Primitives.Patterns.Disposable
RpcClientFactory
Implements
Solti.Utils.Primitives.Patterns.IDisposableEx
IDisposable
IAsyncDisposable
Inherited Members
Solti.Utils.Primitives.Patterns.Disposable.AsyncDispose()
Solti.Utils.Primitives.Patterns.Disposable.BeforeDispose()
Solti.Utils.Primitives.Patterns.Disposable.CheckNotDisposed()
Solti.Utils.Primitives.Patterns.Disposable.Dispose()
Solti.Utils.Primitives.Patterns.Disposable.DisposeAsync()
Solti.Utils.Primitives.Patterns.Disposable.Disposed
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Solti.Utils.Rpc
Assembly: Solti.Utils.Rpc.Client.dll
Syntax
public class RpcClientFactory : Disposable, IDisposableEx, IDisposable, IAsyncDisposable
Remarks

This class and also the created proxy objects are not thread safe.

Constructors

RpcClientFactory(String)

Creates a new RpcClientFactory instance.

Declaration
public RpcClientFactory(string host)
Parameters
Type Name Description
String host

Properties

CustomHeaders

Headers sent along with each request.

Declaration
public IDictionary<string, string> CustomHeaders { get; }
Property Value
Type Description
IDictionary<String, String>
Remarks

You should not set "content-type", it is done by the system automatically.

Host

The address of the remote host (e.g.: "www.mysite.com:1986/api").

Declaration
public string Host { get; }
Property Value
Type Description
String

SerializerOptions

Contains the options for the underlying JsonSerializer.

Declaration
public JsonSerializerOptions SerializerOptions { get; }
Property Value
Type Description
JsonSerializerOptions
Remarks

These options will be applied to serialization and deserialization as well.

ServiceVersion

The Version of the remote service we want to invoke.

Declaration
public Task<Version> ServiceVersion { get; }
Property Value
Type Description
Task<Version>

SessionId

The (optional) session ID related to this instance.

Declaration
public string SessionId { get; set; }
Property Value
Type Description
String

Timeout

Represents the request timeout.

Declaration
public TimeSpan Timeout { get; set; }
Property Value
Type Description
TimeSpan

Methods

CreateClient<TInterface>()

Creates a new RPC client against the given service TInterface.

Declaration
public async Task<TInterface> CreateClient<TInterface>()
    where TInterface : class
Returns
Type Description
Task<TInterface>
Type Parameters
Name Description
TInterface

Dispose(Boolean)

See Dispose().

Declaration
protected override void Dispose(bool disposeManaged)
Parameters
Type Name Description
Boolean disposeManaged
Overrides
Solti.Utils.Primitives.Patterns.Disposable.Dispose(System.Boolean)

GetMemberId(MemberInfo)

Gets the ID of a member.

Declaration
protected virtual string GetMemberId(MemberInfo member)
Parameters
Type Name Description
MemberInfo member
Returns
Type Description
String

GetRequestParameters(MethodInfo)

Gets the request parameters.

Declaration
protected virtual IDictionary<string, string> GetRequestParameters(MethodInfo method)
Parameters
Type Name Description
MethodInfo method
Returns
Type Description
IDictionary<String, String>

InvokeService(MethodInfo, Object[])

Does the actual remote module invocation.

Declaration
protected virtual object InvokeService(MethodInfo method, object[] args)
Parameters
Type Name Description
MethodInfo method
Object[] args
Returns
Type Description
Object

InvokeServiceAsync(MethodInfo, Object[])

Does the actual remote module invocation.

Declaration
protected virtual async Task<object> InvokeServiceAsync(MethodInfo method, object[] args)
Parameters
Type Name Description
MethodInfo method
Object[] args
Returns
Type Description
Task<Object>

ProcessRemoteError(ExceptionInfo)

Processes the ExceptionInfo returned by the remote host.

Declaration
protected virtual void ProcessRemoteError(ExceptionInfo info)
Parameters
Type Name Description
ExceptionInfo info

Implements

Solti.Utils.Primitives.Patterns.IDisposableEx
System.IDisposable
System.IAsyncDisposable
In This Article
Back to top Generated by DocFX