Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Common/MemoryBufferWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public override void Write(byte[] buffer, int offset, int count)
#if NETCOREAPP2_1
public override void Write(ReadOnlySpan<byte> span)
{
if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan().Slice(_position)))
if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan(_position)))
{
_position += span.Length;
_bytesWritten += span.Length;
Expand Down
4 changes: 2 additions & 2 deletions test/Microsoft.AspNetCore.SignalR.Tests/EndToEndTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public async Task WebSocketsTest()
var result = await ws.ReceiveAsync(buffer, CancellationToken.None).OrTimeout();
logger.LogInformation("Received {length} byte frame", result.Count);

Assert.Equal(bytes, buffer.Array.AsSpan().Slice(0, result.Count).ToArray());
Assert.Equal(bytes, buffer.Array.AsSpan(0, result.Count).ToArray());

logger.LogInformation("Closing socket");
await ws.CloseOutputAsync(WebSocketCloseStatus.Empty, "", CancellationToken.None).OrTimeout();
Expand Down Expand Up @@ -145,7 +145,7 @@ public async Task WebSocketsReceivesAndSendsPartialFramesTest()
var result = await ws.ReceiveAsync(buffer, CancellationToken.None).OrTimeout();
logger.LogInformation("Received {length} byte frame", result.Count);

Assert.Equal(bytes, buffer.Array.AsSpan().Slice(0, result.Count).ToArray());
Assert.Equal(bytes, buffer.Array.AsSpan(0, result.Count).ToArray());

logger.LogInformation("Closing socket");
await ws.CloseOutputAsync(WebSocketCloseStatus.Empty, "", CancellationToken.None).OrTimeout();
Expand Down