Client Web Socket implementation (#46)

This commit is contained in:
2023-05-14 22:46:38 +02:00
committed by GitHub
parent a25f2e5acb
commit de08c0e3b0
13 changed files with 234 additions and 107 deletions
@@ -19,7 +19,9 @@ public sealed class HttpClient<Tscope> : IHttpClient<Tscope>, IDisposable
}
remove
{
#pragma warning disable CS8601 // Possible null reference assignment.
this.eventEmitted -= value;
#pragma warning restore CS8601 // Possible null reference assignment.
}
}
public Uri BaseAddress { get => this.httpClient.BaseAddress; set => this.httpClient.BaseAddress = value; }
@@ -27,20 +29,26 @@ public sealed class HttpClient<Tscope> : IHttpClient<Tscope>, IDisposable
public long MaxResponseContentBufferSize { get => this.httpClient.MaxResponseContentBufferSize; set => this.httpClient.MaxResponseContentBufferSize = value; }
public TimeSpan Timeout { get => this.httpClient.Timeout; set => this.httpClient.Timeout = value; }
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public HttpClient()
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
{
this.httpClient = new HttpClient();
this.scope = typeof(Tscope);
}
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public HttpClient(
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
HttpMessageHandler handler)
{
this.httpClient = new HttpClient(handler);
this.scope = typeof(Tscope);
}
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public HttpClient(
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
HttpMessageHandler handler,
bool disposeHandler)
{