From 92b3cb1592dc56838003e7ae40ade5b1867ed0b0 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 15 Feb 2017 11:52:56 -0800 Subject: [PATCH] React to API changes in System.Text.Primitives --- .../TextMessageFormatter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Sockets.Common/TextMessageFormatter.cs b/src/Microsoft.AspNetCore.Sockets.Common/TextMessageFormatter.cs index 39926e0d04..bfa9e0bbba 100644 --- a/src/Microsoft.AspNetCore.Sockets.Common/TextMessageFormatter.cs +++ b/src/Microsoft.AspNetCore.Sockets.Common/TextMessageFormatter.cs @@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Sockets // Encode the payload. For now, we make it an array and use the old-fashioned types because we need to mirror packages // I've filed https://github.com/aspnet/SignalR/issues/192 to update this. -anurse var payload = Convert.ToBase64String(message.Payload.Buffer.ToArray()); - if (!TextEncoder.Utf8.TryEncodeString(payload, buffer, out int payloadWritten)) + if (!TextEncoder.Utf8.TryEncode(payload, buffer, out int payloadWritten)) { bytesWritten = 0; return false; @@ -106,7 +106,7 @@ namespace Microsoft.AspNetCore.Sockets buffer = buffer.Slice(colonIndex); // Parse the length - if (!PrimitiveParser.TryParseInt32(lengthSpan, out var length, out var consumedByLength, EncodingData.InvariantUtf8) || consumedByLength < lengthSpan.Length) + if (!PrimitiveParser.TryParseInt32(lengthSpan, out var length, out var consumedByLength, encoding: EncodingData.InvariantUtf8) || consumedByLength < lengthSpan.Length) { message = default(Message); bytesConsumed = 0; @@ -245,4 +245,4 @@ namespace Microsoft.AspNetCore.Sockets } } } -} \ No newline at end of file +}