1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-06-07 16:06:15 +00:00

Exposed url of websocket

This commit is contained in:
JKorf 2018-10-04 12:02:36 +02:00
parent 4102d4474e
commit 5380f7dd1d
3 changed files with 4 additions and 1 deletions

View File

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

View File

@ -24,6 +24,7 @@ namespace CryptoExchange.Net.Implementation
protected readonly List<Action> closehandlers = new List<Action>();
protected readonly List<Action<string>> messagehandlers = new List<Action<string>>();
public string Url { get; }
public bool IsClosed => socket.State == WebSocketState.Closed;
public bool IsOpen => socket.State == WebSocketState.Open;
@ -56,6 +57,7 @@ namespace CryptoExchange.Net.Implementation
public BaseSocket(Log log, string url, IDictionary<string, string> cookies, IDictionary<string, string> headers)
{
this.log = log;
Url = url;
socket = new WebSocket(url, cookies: cookies.ToList(), customHeaderItems: headers.ToList())
{
EnableAutoSendPing = true,

View File

@ -14,6 +14,7 @@ namespace CryptoExchange.Net.Interfaces
event Action<Exception> OnError;
event Action OnOpen;
string Url { get; }
WebSocketState SocketState { get; }
bool IsClosed { get; }
bool IsOpen { get; }