コード例 #1
0
        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);
        }
コード例 #2
0
 public TestWebSocket()
 {
     CurrentMessage = new ChunkedMemoryStream();
 }