Struct IceObjectProxy
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
invokerIInvokerThe invocation pipeline of the proxy.
serviceAddressServiceAddressThe service address. null is equivalent to an icerpc service address with path DefaultServicePath.
encodeOptionsSliceEncodeOptionsThe 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
invokerIInvokerThe invocation pipeline of the proxy.
serviceAddressUriUriA URI that represents a service address.
encodeOptionsSliceEncodeOptionsThe 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
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
Invoker
Gets or initializes the invocation pipeline of this proxy.
public required IInvoker Invoker { get; init; }
Property Value
ServiceAddress
Gets or initializes the address of the remote service.
public ServiceAddress ServiceAddress { get; init; }
Property Value
Methods
FromPath(string)
Creates a relative proxy from a path.
public static IceObjectProxy FromPath(string path)
Parameters
pathstringThe 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
featuresIFeatureCollectionThe invocation features.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
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
idstringThe Slice type ID of the interface to test against.
featuresIFeatureCollectionThe invocation features.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
IcePingAsync(IFeatureCollection?, CancellationToken)
Pings the service.
public Task IcePingAsync(IFeatureCollection? features = null, CancellationToken cancellationToken = default)
Parameters
featuresIFeatureCollectionThe invocation features.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
- Task
A task that completes when the response is received.