Class IncomingResponse
- Namespace
- IceRpc
- Assembly
- IceRpc.dll
Represents a response frame received by the application.
public sealed class IncomingResponse : IncomingFrame
- Inheritance
-
IncomingResponse
- Inherited Members
- Extension Methods
Constructors
IncomingResponse(OutgoingRequest, IConnectionContext, StatusCode, string?)
Constructs an incoming response with empty fields.
public IncomingResponse(OutgoingRequest request, IConnectionContext connectionContext, StatusCode statusCode = StatusCode.Ok, string? errorMessage = null)
Parameters
request
OutgoingRequestThe corresponding outgoing request.
connectionContext
IConnectionContextThe connection context of the connection that received this response.
statusCode
StatusCodeThe status code of this response.
errorMessage
stringThe error message of this response.
Remarks
The constructor also associates this response with the request. If another response is already set on the request, its payload and payload continuation are completed.
IncomingResponse(OutgoingRequest, IConnectionContext, StatusCode, string?, IDictionary<ResponseFieldKey, ReadOnlySequence<byte>>)
Constructs an incoming response.
public IncomingResponse(OutgoingRequest request, IConnectionContext connectionContext, StatusCode statusCode, string? errorMessage, IDictionary<ResponseFieldKey, ReadOnlySequence<byte>> fields)
Parameters
request
OutgoingRequestThe corresponding outgoing request.
connectionContext
IConnectionContextThe connection context of the connection that received this response.
statusCode
StatusCodeThe status code of this response.
errorMessage
stringThe error message of this response.
fields
IDictionary<ResponseFieldKey, ReadOnlySequence<byte>>The fields of this response.
Remarks
The constructor also associates this response with the request. If another response is already set on the request, its payload and payload continuation are completed.
Properties
ErrorMessage
Gets the error message of this response.
public string? ErrorMessage { get; }
Property Value
- string
The error message of this response if StatusCode is different from Ok; otherwise, null.
Fields
Gets the fields of this incoming response.
public IDictionary<ResponseFieldKey, ReadOnlySequence<byte>> Fields { get; }
Property Value
- IDictionary<ResponseFieldKey, ReadOnlySequence<byte>>
The fields of this incoming response. Defaults to Empty.
StatusCode
Gets the StatusCode of this response.
public StatusCode StatusCode { get; }
Property Value
- StatusCode
The StatusCode of this response.