Adding default ctors for HubProtocols
This commit is contained in:
parent
ba25dee141
commit
126901a08f
|
|
@ -46,7 +46,7 @@ namespace Microsoft.AspNetCore.SignalR.Client
|
||||||
var loggerFactory = ((IHubConnectionBuilder)this).GetLoggerFactory();
|
var loggerFactory = ((IHubConnectionBuilder)this).GetLoggerFactory();
|
||||||
var hubProtocol = ((IHubConnectionBuilder)this).GetHubProtocol();
|
var hubProtocol = ((IHubConnectionBuilder)this).GetHubProtocol();
|
||||||
|
|
||||||
return new HubConnection(connection, hubProtocol ?? new JsonHubProtocol(new JsonSerializer()), loggerFactory);
|
return new HubConnection(connection, hubProtocol ?? new JsonHubProtocol(), loggerFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
|
|
|
||||||
|
|
@ -18,13 +18,13 @@ namespace Microsoft.AspNetCore.SignalR.Client
|
||||||
|
|
||||||
public static IHubConnectionBuilder WithJsonProtocol(this IHubConnectionBuilder hubConnectionBuilder)
|
public static IHubConnectionBuilder WithJsonProtocol(this IHubConnectionBuilder hubConnectionBuilder)
|
||||||
{
|
{
|
||||||
return hubConnectionBuilder.WithHubProtocol(new JsonHubProtocol(new JsonSerializer()));
|
return hubConnectionBuilder.WithHubProtocol(new JsonHubProtocol());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IHubConnectionBuilder WithMessagePackProtocol(this IHubConnectionBuilder hubConnectionBuilder)
|
public static IHubConnectionBuilder WithMessagePackProtocol(this IHubConnectionBuilder hubConnectionBuilder)
|
||||||
{
|
{
|
||||||
return hubConnectionBuilder.WithHubProtocol(
|
return hubConnectionBuilder.WithHubProtocol(
|
||||||
new MessagePackHubProtocol(MessagePackHubProtocol.CreateDefaultSerializationContext()));
|
new MessagePackHubProtocol());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IHubConnectionBuilder WithLoggerFactory(this IHubConnectionBuilder hubConnectionBuilder, ILoggerFactory loggerFactory)
|
public static IHubConnectionBuilder WithLoggerFactory(this IHubConnectionBuilder hubConnectionBuilder, ILoggerFactory loggerFactory)
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,15 @@ namespace Microsoft.AspNetCore.SignalR.Internal.Protocol
|
||||||
// ONLY to be used for application payloads (args, return values, etc.)
|
// ONLY to be used for application payloads (args, return values, etc.)
|
||||||
private JsonSerializer _payloadSerializer;
|
private JsonSerializer _payloadSerializer;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates an instance of the <see cref="JsonHubProtocol"/> using the default <see cref="JsonSerializer"/>
|
||||||
|
/// to serialize application payloads (arguments, results, etc.). The serialization of the outer protocol can
|
||||||
|
/// NOT be changed using this serializer.
|
||||||
|
/// </summary>
|
||||||
|
public JsonHubProtocol()
|
||||||
|
: this(new JsonSerializer())
|
||||||
|
{ }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instance of the <see cref="JsonHubProtocol"/> using the specified <see cref="JsonSerializer"/>
|
/// Creates an instance of the <see cref="JsonHubProtocol"/> using the specified <see cref="JsonSerializer"/>
|
||||||
/// to serialize application payloads (arguments, results, etc.). The serialization of the outer protocol can
|
/// to serialize application payloads (arguments, results, etc.). The serialization of the outer protocol can
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@ namespace Microsoft.AspNetCore.SignalR.Internal.Protocol
|
||||||
|
|
||||||
public ProtocolType Type => ProtocolType.Binary;
|
public ProtocolType Type => ProtocolType.Binary;
|
||||||
|
|
||||||
|
public MessagePackHubProtocol()
|
||||||
|
: this(CreateDefaultSerializationContext())
|
||||||
|
{ }
|
||||||
|
|
||||||
public MessagePackHubProtocol(SerializationContext serializationContext)
|
public MessagePackHubProtocol(SerializationContext serializationContext)
|
||||||
{
|
{
|
||||||
_serializationContext = serializationContext;
|
_serializationContext = serializationContext;
|
||||||
|
|
|
||||||
|
|
@ -245,8 +245,8 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
|
||||||
public static IEnumerable<IHubProtocol> HubProtocols =>
|
public static IEnumerable<IHubProtocol> HubProtocols =>
|
||||||
new IHubProtocol[]
|
new IHubProtocol[]
|
||||||
{
|
{
|
||||||
new JsonHubProtocol(new JsonSerializer()),
|
new JsonHubProtocol(),
|
||||||
new MessagePackHubProtocol(MessagePackHubProtocol.CreateDefaultSerializationContext()),
|
new MessagePackHubProtocol(),
|
||||||
};
|
};
|
||||||
|
|
||||||
public static IEnumerable<TransportType> TransportTypes()
|
public static IEnumerable<TransportType> TransportTypes()
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
private async Task InvokeOn(Action<HubConnection, TaskCompletionSource<object[]>> onAction, object[] args)
|
private async Task InvokeOn(Action<HubConnection, TaskCompletionSource<object[]>> onAction, object[] args)
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
var handlerTcs = new TaskCompletionSource<object[]>();
|
var handlerTcs = new TaskCompletionSource<object[]>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -169,7 +169,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task ConnectionClosedOnCallbackArgumentTypeMismatch()
|
public async Task ConnectionClosedOnCallbackArgumentTypeMismatch()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
var closeTcs = new TaskCompletionSource<Exception>();
|
var closeTcs = new TaskCompletionSource<Exception>();
|
||||||
hubConnection.Closed += e =>
|
hubConnection.Closed += e =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task SendAsyncSendsANonBlockingInvocationMessage()
|
public async Task SendAsyncSendsANonBlockingInvocationMessage()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task ClientSendsNegotationMessageWhenStartingConnection()
|
public async Task ClientSendsNegotationMessageWhenStartingConnection()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task InvokeSendsAnInvocationMessage()
|
public async Task InvokeSendsAnInvocationMessage()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -93,7 +93,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task StreamSendsAnInvocationMessage()
|
public async Task StreamSendsAnInvocationMessage()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -121,7 +121,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task InvokeCompletedWhenCompletionMessageReceived()
|
public async Task InvokeCompletedWhenCompletionMessageReceived()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -165,7 +165,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task InvokeYieldsResultWhenCompletionMessageReceived()
|
public async Task InvokeYieldsResultWhenCompletionMessageReceived()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -187,7 +187,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task StreamFailsIfCompletionMessageHasPayload()
|
public async Task StreamFailsIfCompletionMessageHasPayload()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -210,7 +210,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task InvokeFailsWithExceptionWhenCompletionWithErrorReceived()
|
public async Task InvokeFailsWithExceptionWhenCompletionWithErrorReceived()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -233,7 +233,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task StreamFailsWithExceptionWhenCompletionWithErrorReceived()
|
public async Task StreamFailsWithExceptionWhenCompletionWithErrorReceived()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -256,7 +256,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task InvokeFailsWithErrorWhenStreamingItemReceived()
|
public async Task InvokeFailsWithErrorWhenStreamingItemReceived()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -279,7 +279,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task StreamYieldsItemsAsTheyArrive()
|
public async Task StreamYieldsItemsAsTheyArrive()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
|
|
@ -306,7 +306,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task HandlerRegisteredWithOnIsFiredWhenInvocationReceived()
|
public async Task HandlerRegisteredWithOnIsFiredWhenInvocationReceived()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
var handlerCalled = new TaskCompletionSource<object[]>();
|
var handlerCalled = new TaskCompletionSource<object[]>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -332,7 +332,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
var connection = new TestConnection(TransferMode.Text);
|
var connection = new TestConnection(TransferMode.Text);
|
||||||
|
|
||||||
var hubConnection = new HubConnection(connection,
|
var hubConnection = new HubConnection(connection,
|
||||||
new MessagePackHubProtocol(MessagePackHubProtocol.CreateDefaultSerializationContext()), new LoggerFactory());
|
new MessagePackHubProtocol(), new LoggerFactory());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await hubConnection.StartAsync().OrTimeout();
|
await hubConnection.StartAsync().OrTimeout();
|
||||||
|
|
@ -363,7 +363,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
{
|
{
|
||||||
var connection = new TestConnection(TransferMode.Text);
|
var connection = new TestConnection(TransferMode.Text);
|
||||||
var hubConnection = new HubConnection(connection,
|
var hubConnection = new HubConnection(connection,
|
||||||
new MessagePackHubProtocol(MessagePackHubProtocol.CreateDefaultSerializationContext()), new LoggerFactory());
|
new MessagePackHubProtocol(), new LoggerFactory());
|
||||||
|
|
||||||
var invocationTcs = new TaskCompletionSource<int>();
|
var invocationTcs = new TaskCompletionSource<int>();
|
||||||
try
|
try
|
||||||
|
|
@ -373,7 +373,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
|
|
||||||
using (var ms = new MemoryStream())
|
using (var ms = new MemoryStream())
|
||||||
{
|
{
|
||||||
new MessagePackHubProtocol(MessagePackHubProtocol.CreateDefaultSerializationContext())
|
new MessagePackHubProtocol()
|
||||||
.WriteMessage(new InvocationMessage("1", true, "MyMethod", 42), ms);
|
.WriteMessage(new InvocationMessage("1", true, "MyMethod", 42), ms);
|
||||||
|
|
||||||
var invokeMessage = Convert.ToBase64String(ms.ToArray());
|
var invokeMessage = Convert.ToBase64String(ms.ToArray());
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task CannotCallInvokeOnClosedHubConnection()
|
public async Task CannotCallInvokeOnClosedHubConnection()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
|
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
await hubConnection.DisposeAsync();
|
await hubConnection.DisposeAsync();
|
||||||
|
|
@ -114,7 +114,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
public async Task PendingInvocationsAreCancelledWhenConnectionClosesCleanly()
|
public async Task PendingInvocationsAreCancelledWhenConnectionClosesCleanly()
|
||||||
{
|
{
|
||||||
var connection = new TestConnection();
|
var connection = new TestConnection();
|
||||||
var hubConnection = new HubConnection(connection, new JsonHubProtocol(new JsonSerializer()), new LoggerFactory());
|
var hubConnection = new HubConnection(connection, new JsonHubProtocol(), new LoggerFactory());
|
||||||
|
|
||||||
await hubConnection.StartAsync();
|
await hubConnection.StartAsync();
|
||||||
var invokeTask = hubConnection.InvokeAsync<int>("testMethod");
|
var invokeTask = hubConnection.InvokeAsync<int>("testMethod");
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol
|
||||||
input = Frame(input);
|
input = Frame(input);
|
||||||
|
|
||||||
var binder = new TestBinder();
|
var binder = new TestBinder();
|
||||||
var protocol = new JsonHubProtocol(new JsonSerializer());
|
var protocol = new JsonHubProtocol();
|
||||||
var ex = Assert.Throws<FormatException>(() => protocol.TryParseMessages(Encoding.UTF8.GetBytes(input), binder, out var messages));
|
var ex = Assert.Throws<FormatException>(() => protocol.TryParseMessages(Encoding.UTF8.GetBytes(input), binder, out var messages));
|
||||||
Assert.Equal(expectedMessage, ex.Message);
|
Assert.Equal(expectedMessage, ex.Message);
|
||||||
}
|
}
|
||||||
|
|
@ -133,7 +133,7 @@ namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol
|
||||||
input = Frame(input);
|
input = Frame(input);
|
||||||
|
|
||||||
var binder = new TestBinder(paramTypes: new[] { typeof(int), typeof(string) }, returnType: typeof(bool));
|
var binder = new TestBinder(paramTypes: new[] { typeof(int), typeof(string) }, returnType: typeof(bool));
|
||||||
var protocol = new JsonHubProtocol(new JsonSerializer());
|
var protocol = new JsonHubProtocol();
|
||||||
var ex = Assert.Throws<FormatException>(() => protocol.TryParseMessages(Encoding.UTF8.GetBytes(input), binder, out var messages));
|
var ex = Assert.Throws<FormatException>(() => protocol.TryParseMessages(Encoding.UTF8.GetBytes(input), binder, out var messages));
|
||||||
Assert.Equal(expectedMessage, ex.Message);
|
Assert.Equal(expectedMessage, ex.Message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol
|
||||||
public class MessagePackHubProtocolTests
|
public class MessagePackHubProtocolTests
|
||||||
{
|
{
|
||||||
private static readonly MessagePackHubProtocol _hubProtocol
|
private static readonly MessagePackHubProtocol _hubProtocol
|
||||||
= new MessagePackHubProtocol(MessagePackHubProtocol.CreateDefaultSerializationContext());
|
= new MessagePackHubProtocol();
|
||||||
|
|
||||||
public static IEnumerable<object[]> TestMessages => new[]
|
public static IEnumerable<object[]> TestMessages => new[]
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,8 @@ namespace Microsoft.AspNetCore.SignalR.Common.Protocol.Tests
|
||||||
public static IEnumerable<object[]> HubProtocols =>
|
public static IEnumerable<object[]> HubProtocols =>
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new object[] { new JsonHubProtocol(new JsonSerializer()) },
|
new object[] { new JsonHubProtocol() },
|
||||||
new object[] { new MessagePackHubProtocol(MessagePackHubProtocol.CreateDefaultSerializationContext()) },
|
new object[] { new MessagePackHubProtocol() },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
||||||
Connection.User = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, Interlocked.Increment(ref _id).ToString()) }));
|
Connection.User = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, Interlocked.Increment(ref _id).ToString()) }));
|
||||||
Connection.Metadata["ConnectedTask"] = new TaskCompletionSource<bool>();
|
Connection.Metadata["ConnectedTask"] = new TaskCompletionSource<bool>();
|
||||||
|
|
||||||
protocol = protocol ?? new JsonHubProtocol(new JsonSerializer());
|
protocol = protocol ?? new JsonHubProtocol();
|
||||||
_protocolReaderWriter = new HubProtocolReaderWriter(protocol, new PassThroughEncoder());
|
_protocolReaderWriter = new HubProtocolReaderWriter(protocol, new PassThroughEncoder());
|
||||||
|
|
||||||
_cts = new CancellationTokenSource();
|
_cts = new CancellationTokenSource();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue