/// <summary>
 /// Creates an instance of a WebSocketReadFrame.
 /// </summary>
 /// <param name="header">The header of the WebSocket frame.</param>
 /// <param name="payload">A message reader for reading the WebSocket payload.</param>
 public WebSocketReadFrame(WebSocketHeader header, WebSocketPayloadReader payload)
 {
     Header  = header;
     Payload = payload;
 }
Exemple #2
0
 /// <summary>
 /// Creates an instance of a WebSocketWriteFrame.
 /// </summary>
 /// <param name="header">The header of the WebSocket frame.</param>
 /// <param name="payload">The payload of the WebSocket frame.</param>
 public WebSocketWriteFrame(WebSocketHeader header, ReadOnlySequence <byte> payload)
 {
     Header  = header;
     Payload = payload;
 }
 /// <summary>
 /// Creates an instance of a WebSocketPayloadReader.
 /// </summary>
 /// <param name="header">The WebSocketHeader associated with this payload.</param>
 public WebSocketPayloadReader(WebSocketHeader header)
 {
     _payloadBytesRemaining = header.PayloadLength;
     _payloadEncoder        = new WebSocketPayloadEncoder(header.MaskingKey);
     _masked = header.Masked;
 }