Squirrowse/Squirrowse.Client/Service/ConnectionManager.cs
danielgrabowski e91a5143dd Codecleanup
2019-11-04 09:29:37 +01:00

24 lines
637 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 Connect()
{
return _connection;
}
}
}