Change again socket reconnect logic

This commit is contained in:
rafael-aero
2021-12-15 10:44:59 +01:00
parent 4a3a5c6aa4
commit 8cb235527d
3 changed files with 76 additions and 131 deletions

View File

@@ -25,6 +25,24 @@ namespace ElectronNET.API
/// </summary>
public static bool SocketDebug { get; set; }
/// <summary>
/// Handle hard fails of connecting to the socket. The application must exit when this event is raised.
/// The default behavior is to exit with code 0xDEAD
/// </summary>
public static event Action OnSocketConnectFail;
internal static bool TryRaiseOnSocketConnectFail()
{
if (OnSocketConnectFail is object)
{
OnSocketConnectFail();
return true;
}
else
{
return false;
}
}
/// <summary>
/// Emitted when the user clicks on the dock on Mac