Table of Contents

Struct IceObjectProxy

Namespace
IceRpc.Slice.Ice
Assembly
IceRpc.Slice.dll

Implements IIceObject by making invocations on a remote IceRPC service. This remote service must implement Slice interface Ice::Object.

[SliceTypeId("::Ice::Object")]
public readonly record struct IceObjectProxy : IIceObject, IProxy, IEquatable<IceObjectProxy>
Implements
Inherited Members
Extension Methods

Remarks

The Slice compiler generated this record struct from the Slice interface Ice::Object.

Constructors

IceObjectProxy()

Constructs a proxy with an icerpc service address with path DefaultServicePath.

public IceObjectProxy()

IceObjectProxy(IInvoker, ServiceAddress?, SliceEncodeOptions?)

Constructs a proxy from an invoker, a service address and encode options.

public IceObjectProxy(IInvoker invoker, ServiceAddress? serviceAddress = null, SliceEncodeOptions? encodeOptions = null)

Parameters

invoker IInvoker

The invocation pipeline of the proxy.

serviceAddress ServiceAddress

The service address. null is equivalent to an icerpc service address with path DefaultServicePath.

encodeOptions SliceEncodeOptions

The encode options, used to customize the encoding of request payloads.

IceObjectProxy(IInvoker, Uri, SliceEncodeOptions?)

Constructs a proxy from an invoker, a service address URI and encode options.

public IceObjectProxy(IInvoker invoker, Uri serviceAddressUri, SliceEncodeOptions? encodeOptions = null)

Parameters

invoker IInvoker

The invocation pipeline of the proxy.

serviceAddressUri Uri

A URI that represents a service address.

encodeOptions SliceEncodeOptions

The encode options, used to customize the encoding of request payloads.

Fields

DefaultServicePath

Represents the default path for IceRPC services that implement Slice interface Ice::Object.

public const string DefaultServicePath = "/Ice.Object"

Field Value

string

Properties

EncodeOptions

Gets or initializes the encode options, used to customize the encoding of payloads created from this proxy.

public SliceEncodeOptions? EncodeOptions { get; init; }

Property Value

SliceEncodeOptions

Invoker

Gets or initializes the invocation pipeline of this proxy.

public required IInvoker Invoker { get; init; }

Property Value

IInvoker

ServiceAddress

Gets or initializes the address of the remote service.

public ServiceAddress ServiceAddress { get; init; }

Property Value

ServiceAddress

Methods

FromPath(string)

Creates a relative proxy from a path.

public static IceObjectProxy FromPath(string path)

Parameters

path string

The path.

Returns

IceObjectProxy

The new relative proxy.

IceIdsAsync(IFeatureCollection?, CancellationToken)

Gets the Slice type IDs of all the interfaces implemented by the target service.

public Task<string[]> IceIdsAsync(IFeatureCollection? features = null, CancellationToken cancellationToken = default)

Parameters

features IFeatureCollection

The invocation features.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<string[]>

The Slice type IDs of all these interfaces, sorted alphabetically.

IceIsAAsync(string, IFeatureCollection?, CancellationToken)

Tests whether the target service implements the specified interface.

public Task<bool> IceIsAAsync(string id, IFeatureCollection? features = null, CancellationToken cancellationToken = default)

Parameters

id string

The Slice type ID of the interface to test against.

features IFeatureCollection

The invocation features.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<bool>

True when the target service implements this interface; otherwise, false.

IcePingAsync(IFeatureCollection?, CancellationToken)

Pings the service.

public Task IcePingAsync(IFeatureCollection? features = null, CancellationToken cancellationToken = default)

Parameters

features IFeatureCollection

The invocation features.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task

A task that completes when the response is received.