public override Task SendAsync(ArraySegment <byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken) { if (buffer.Array != null) { CurrentMessage.Write(buffer.Array, buffer.Offset, buffer.Count); } if (endOfMessage) { Messages.Add(CurrentMessage); CurrentMessage = new ChunkedMemoryStream(); } return(Task.CompletedTask); }
public TestWebSocket() { CurrentMessage = new ChunkedMemoryStream(); }