Class ClientPipelineOptions
Options that control the creation of a ClientPipeline used by a service client to send and receive HTTP messages. Service clients must create a client-specific subtype of this class to pass to their constructors to allow for service-specific options with a client-wide scope.
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: System.ClientModel.dll
Syntax
[System.Runtime.CompilerServices.Nullable(0)]
[System.Runtime.CompilerServices.NullableContext(2)]
public class ClientPipelineOptions
Constructors
ClientPipelineOptions()
Declaration
public ClientPipelineOptions ();
Properties
ClientLoggingOptions
The options to be used to configure logging within the ClientPipeline.
Declaration
public System.ClientModel.Primitives.ClientLoggingOptions ClientLoggingOptions { get; set; }
Property Value
ClientLoggingOptions
|
EnableDistributedTracing
Gets or sets whether distributed tracing should be enabled. If null
, this
value will be treated as true
. The default is null
.
Declaration
public Nullable<bool> EnableDistributedTracing { get; set; }
Property Value
System.Nullable<System.Boolean>
|
MessageLoggingPolicy
Gets or sets the PipelinePolicy to be used by the ClientPipeline for logging.
Declaration
public System.ClientModel.Primitives.PipelinePolicy MessageLoggingPolicy { get; set; }
Property Value
PipelinePolicy
|
Remarks
In most cases, this property will be set to an instance of MessageLoggingPolicy.
NetworkTimeout
The timeout applied to an individual network operation.
Declaration
public Nullable<TimeSpan> NetworkTimeout { get; set; }
Property Value
System.Nullable<System.TimeSpan>
|
RetryPolicy
Gets or sets the PipelinePolicy to be used by the ClientPipeline for handling retry logic.
Declaration
public System.ClientModel.Primitives.PipelinePolicy RetryPolicy { get; set; }
Property Value
PipelinePolicy
|
Remarks
In most cases, this property will be set to an instance of ClientRetryPolicy.
Transport
Gets or sets the PipelineTransport to be used by the ClientPipeline for sending and receiving HTTP messages.
Declaration
public System.ClientModel.Primitives.PipelineTransport Transport { get; set; }
Property Value
PipelineTransport
|
Remarks
In most cases, this property will be set to an instance of HttpClientPipelineTransport.
Methods
AddPolicy(PipelinePolicy, PipelinePosition)
Adds the provided PipelinePolicy to the default ClientPipeline.
Declaration
[System.Runtime.CompilerServices.NullableContext(1)]
public void AddPolicy (System.ClientModel.Primitives.PipelinePolicy policy, System.ClientModel.Primitives.PipelinePosition position);
Parameters
PipelinePolicy
policy
The PipelinePolicy to add to the pipeline. |
PipelinePosition
position
The position of the policy in the pipeline. |
Remarks
For a policy to run once per invocation of Send(PipelineMessage), use PerCall, which will insert the policy before the pipeline's RetryPolicy. For a policy to run once per retry attempt, use PerTry, which will insert the policy after the pipeline's RetryPolicy. To ensure that a policy runs after all other policies in the pipeline have viewed the Request and before all other policies view the Response, use BeforeTransport. Changes made to Request by a before-transport policy will not be visible to any logging policies that come before it in the pipeline.
Exceptions
System.ArgumentException
Thrown when the provided policy
is |
AssertNotFrozen()
Assert that Freeze() has not been called on this ClientPipelineOptions instance.
Declaration
protected void AssertNotFrozen ();
Exceptions
System.InvalidOperationException
Thrown when an attempt is made to change the state of this ClientPipelineOptions instance after Freeze() has been called. |
Freeze()
Freeze this instance of ClientPipelineOptions. After this method has been called, any attempt to set properties on the instance or call methods that would change its state will throw System.InvalidOperationException.
Declaration
public virtual void Freeze ();