提交 4123b1c0 编写于 作者: S Sam Harwell

Work around incorrect implementation of WithMultiplexingStream

This method was corrected for 16.8 Preview 3.
上级 8ca0f596
......@@ -6,6 +6,7 @@
using System;
using System.IO.Pipelines;
using System.Reflection;
using MessagePack;
using MessagePack.Resolvers;
using Microsoft.ServiceHub.Framework;
......@@ -78,6 +79,26 @@ protected override JsonRpcConnection CreateConnection(JsonRpc jsonRpc)
return connection;
}
public override ServiceRpcDescriptor WithMultiplexingStream(MultiplexingStream? multiplexingStream)
{
var baseResult = base.WithMultiplexingStream(multiplexingStream);
if (baseResult is ServiceDescriptor)
return baseResult;
// work around incorrect implementation in 16.8 Preview 2
if (MultiplexingStream == multiplexingStream)
return this;
var result = (ServiceDescriptor)Clone();
typeof(ServiceRpcDescriptor).GetProperty(nameof(MultiplexingStream))!.SetValue(result, multiplexingStream);
if (result.MultiplexingStreamOptions is null)
return result;
result = (ServiceDescriptor)result.Clone();
typeof(ServiceJsonRpcDescriptor).GetProperty(nameof(MultiplexingStreamOptions))!.SetValue(result, value: null);
return result;
}
internal static class TestAccessor
{
public static MessagePackSerializerOptions Options => s_options;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册