Squirrowse/Squirrowse.Client/Service/ConnectionManager.cs
danielgrabowski 3de1b04cb4 + common packages
+ Tests for common core
2019-10-31 17:00:52 +01:00

21 lines
616 B
C#

using Microsoft.AspNetCore.SignalR.Client;
using Microsoft.Extensions.DependencyInjection;
namespace Squirrowse.Client.Service
{
public class ConnectionManager : IConnectionManager
{
private readonly HubConnection _connection;
public ConnectionManager(string url, int port)
{
_connection = new HubConnectionBuilder()
.WithUrl($"{url}:{port}/StreamHub")
.AddMessagePackProtocol()
.WithAutomaticReconnect()
.Build();
}
public HubConnection EstablishHubConnection() => _connection;
}
}