Core logic ported from TS: HttpClientFactory, Environment and WebSocketHandler.
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using Chtn.CSharpSDK.Interfaces;
|
||||
using System.Net.Http;
|
||||
using System;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Net.WebSockets;
|
||||
using System.Threading.Tasks;
|
||||
using Chtn.CSharpSDK.Interfaces;
|
||||
|
||||
|
||||
namespace Chtn.CSharpSDK.Core
|
||||
{
|
||||
@@ -8,15 +11,17 @@ namespace Chtn.CSharpSDK.Core
|
||||
{
|
||||
private readonly IKeyringAPI _keyring;
|
||||
private readonly IDatabaseAPI _database;
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly WebSocketHandler _wsHandler;
|
||||
|
||||
public ChateniumClient(IKeyringAPI keyring, IDatabaseAPI database)
|
||||
{
|
||||
_keyring = keyring ?? throw new ArgumentNullException(nameof(keyring));
|
||||
_database = database ?? throw new ArgumentNullException(nameof(database));
|
||||
|
||||
_httpClient = new HttpClient();
|
||||
_httpClient.BaseAddress = new Uri("https://api.chatenium.hu");
|
||||
_wsHandler = WebSocketHandler.GetInstance();
|
||||
}
|
||||
public async Task ConnectAsync(string userId, string token)
|
||||
{
|
||||
await _wsHandler.ConnectAsync(userId, token);
|
||||
}
|
||||
public void initialize()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user