Add Url + ILoggerFactory ctor for HubConnection (#253)

This commit is contained in:
Mikael Mengistu 2017-02-28 16:52:42 -08:00 committed by GitHub
parent 0abac4a20d
commit c3b33a2676
2 changed files with 8 additions and 8 deletions

View File

@ -46,14 +46,14 @@ namespace Microsoft.AspNetCore.SignalR.Client
remove { _connection.Closed -= value; }
}
public HubConnection(Uri url, IInvocationAdapter adapter)
: this(new Connection(url), adapter, null)
{ }
public HubConnection(Uri url)
: this(new Connection(url), new JsonNetInvocationAdapter(), null)
{ }
public HubConnection(Uri url, ILoggerFactory loggerFactory)
: this(new Connection(url), new JsonNetInvocationAdapter(), loggerFactory)
{ }
public HubConnection(Uri url, IInvocationAdapter adapter, ILoggerFactory loggerFactory)
: this(new Connection(url, loggerFactory), adapter, loggerFactory)
{ }

View File

@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
using (var httpClient = _testServer.CreateClient())
{
var transport = new LongPollingTransport(httpClient, loggerFactory);
var connection = new HubConnection(new Uri("http://test/hubs"), new JsonNetInvocationAdapter());
var connection = new HubConnection(new Uri("http://test/hubs"));
try
{
await connection.StartAsync(transport, httpClient);
@ -76,7 +76,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
using (var httpClient = _testServer.CreateClient())
{
var transport = new LongPollingTransport(httpClient, loggerFactory);
var connection = new HubConnection(new Uri("http://test/hubs"), new JsonNetInvocationAdapter());
var connection = new HubConnection(new Uri("http://test/hubs"));
try
{
await connection.StartAsync(transport, httpClient);
@ -126,7 +126,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
using (var httpClient = _testServer.CreateClient())
{
var transport = new LongPollingTransport(httpClient, loggerFactory);
var connection = new HubConnection(new Uri("http://test/hubs"), new JsonNetInvocationAdapter());
var connection = new HubConnection(new Uri("http://test/hubs"));
try
{
await connection.StartAsync(transport, httpClient);
@ -156,7 +156,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
using (var httpClient = _testServer.CreateClient())
{
var transport = new LongPollingTransport(httpClient, loggerFactory);
var connection = new HubConnection(new Uri("http://test/hubs"), new JsonNetInvocationAdapter());
var connection = new HubConnection(new Uri("http://test/hubs"));
try
{
await connection.StartAsync(transport, httpClient);