| | | 1 | | // Copyright (c) ZeroC, Inc. |
| | | 2 | | |
| | | 3 | | using IceRpc.Internal; |
| | | 4 | | using System.IO.Pipelines; |
| | | 5 | | |
| | | 6 | | namespace IceRpc; |
| | | 7 | | |
| | | 8 | | /// <summary>Represents the base class for incoming frames.</summary> |
| | | 9 | | public class IncomingFrame |
| | | 10 | | { |
| | | 11 | | /// <summary>Gets or sets the connection context.</summary> |
| | | 12 | | /// <value>The <see cref="IConnectionContext"/> of this frame.</value> |
| | 11318 | 13 | | public IConnectionContext ConnectionContext { get; set; } |
| | | 14 | | |
| | | 15 | | /// <summary>Gets or sets the payload of this frame.</summary> |
| | | 16 | | /// <value>The payload of this frame. Defaults to a <see cref="PipeReader" /> that returns an empty sequence. |
| | | 17 | | /// </value> |
| | | 18 | | /// <remarks>IceRPC completes the payload <see cref="PipeReader" /> with the <see |
| | | 19 | | /// cref="PipeReader.Complete(Exception?)" /> method. It never calls <see |
| | | 20 | | /// cref="PipeReader.CompleteAsync(Exception?)" />. The implementation of <see |
| | | 21 | | /// cref="PipeReader.Complete(Exception?)" /> should not block.</remarks> |
| | 33283 | 22 | | public PipeReader Payload { get; set; } = EmptyPipeReader.Instance; |
| | | 23 | | |
| | | 24 | | /// <summary>Gets the protocol of this frame.</summary> |
| | | 25 | | /// <value>The <see cref="IceRpc.Protocol" /> of this frame.</value> |
| | 8401 | 26 | | public Protocol Protocol { get; } |
| | | 27 | | |
| | | 28 | | /// <summary>Constructs an incoming frame.</summary> |
| | | 29 | | /// <param name="protocol">The protocol of this frame.</param> |
| | | 30 | | /// <param name="connectionContext">The connection context of the connection that received this frame.</param> |
| | 11248 | 31 | | private protected IncomingFrame(Protocol protocol, IConnectionContext connectionContext) |
| | 11248 | 32 | | { |
| | 11248 | 33 | | ConnectionContext = connectionContext; |
| | 11248 | 34 | | Protocol = protocol; |
| | 11248 | 35 | | } |
| | | 36 | | } |