1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-27 09:46:14 +00:00

Added ConfigureAwait(false) in socket connections

This commit is contained in:
JKorf 2018-03-12 10:32:27 +01:00
parent 7996fa4c20
commit d0177248c8
2 changed files with 5 additions and 3 deletions
CryptoExchange.Net

@ -7,7 +7,7 @@
<PropertyGroup>
<PackageId>CryptoExchange.Net</PackageId>
<Authors>JKorf</Authors>
<PackageVersion>0.0.10</PackageVersion>
<PackageVersion>0.0.11</PackageVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageProjectUrl>https://github.com/JKorf/CryptoExchange.Net</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/JKorf/CryptoExchange.Net/blob/master/LICENSE</PackageLicenseUrl>

@ -30,6 +30,8 @@ namespace CryptoExchange.Net.Implementation
public BaseSocket(string url, IDictionary<string, string> cookies, IDictionary<string, string> headers)
{
socket = new WebSocket(url, cookies: cookies.ToList(), customHeaderItems: headers.ToList());
socket.EnableAutoSendPing = true;
socket.AutoSendPingInterval = 10;
socket.Opened += (o, s) => Handle(openhandlers);
socket.Closed += (o, s) => Handle(closehandlers);
socket.Error += (o, s) => Handle(errorhandlers, s.Exception);
@ -79,7 +81,7 @@ namespace CryptoExchange.Net.Implementation
socket.Close();
evnt.WaitOne();
socket.Closed -= handler;
});
}).ConfigureAwait(false);
}
public void Send(string data)
@ -100,7 +102,7 @@ namespace CryptoExchange.Net.Implementation
socket.Opened -= handler;
socket.Closed -= handler;
return socket.State == WebSocketState.Open;
});
}).ConfigureAwait(false);
}
public void SetEnabledSslProtocols(SslProtocols protocols)