1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-19 12:22:56 +00:00

Some resharper fixes

This commit is contained in:
JKorf
2018-12-06 10:53:01 +01:00
parent e5f712633e
commit 181be6c17e
16 changed files with 51 additions and 76 deletions
+4 -12
View File
@@ -55,15 +55,7 @@ namespace CryptoExchange.Net.Sockets
set => socket.AutoSendPingInterval = (int) Math.Round(value.TotalSeconds);
}
public WebSocketState SocketState
{
get
{
if (socket == null)
return WebSocketState.None;
return socket.State;
}
}
public WebSocketState SocketState => socket?.State ?? WebSocketState.None;
public BaseSocket(Log log, string url):this(log, url, new Dictionary<string, string>(), new Dictionary<string, string>())
{
@@ -151,7 +143,7 @@ namespace CryptoExchange.Net.Sockets
var waitLock = new object();
log?.Write(LogVerbosity.Debug, $"Socket {Id} closing");
ManualResetEvent evnt = new ManualResetEvent(false);
var evnt = new ManualResetEvent(false);
var handler = new EventHandler((o, a) =>
{
lock(waitLock)
@@ -200,7 +192,7 @@ namespace CryptoExchange.Net.Sockets
{
log?.Write(LogVerbosity.Debug, $"Socket {Id} connecting");
var waitLock = new object();
ManualResetEvent evnt = new ManualResetEvent(false);
var evnt = new ManualResetEvent(false);
var handler = new EventHandler((o, a) =>
{
lock (waitLock)
@@ -266,7 +258,7 @@ namespace CryptoExchange.Net.Sockets
}
}
private int NextStreamId()
private static int NextStreamId()
{
lock (streamIdLock)
{
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CryptoExchange.Net.Sockets
public string WaitingId { get; set; }
private CallResult<bool> result;
private ManualResetEvent setEvnt;
private readonly ManualResetEvent setEvnt;
public SocketEvent(string name)
{