fix multi thread usage missing lock

This commit is contained in:
rafael-aero
2022-03-23 12:18:52 +01:00
parent 967ccf385a
commit 13edd4c3ca
2 changed files with 77 additions and 58 deletions

View File

@@ -444,7 +444,8 @@ namespace ElectronNET.API
ReconnectionDelay = 500,
ReconnectionDelayMax = 2000,
RandomizationFactor = 0.5,
ConnectionTimeout = TimeSpan.FromSeconds(10)
ConnectionTimeout = TimeSpan.FromSeconds(10),
Transport = SocketIOClient.Transport.TransportProtocol.WebSocket
});
socket.JsonSerializer = new CamelCaseNewtonsoftJsonSerializer();
@@ -485,6 +486,12 @@ namespace ElectronNET.API
Log("ElectronNET socket {2} disconnected with reason {0}, trying to reconnect on port {1}!", reason, BridgeSettings.SocketPort, socket.Id);
};
socket.OnError += (_, msg) =>
{
//_connectedSocketEvent.Reset();
Log("ElectronNET socket {1} error: {0}...", msg, socket.Id);
};
_socket = socket;
Task.Run(async () =>