mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-15 21:26:10 +00:00
Moved into src folder
This commit is contained in:
33
src/ElectronNET.API/BridgeConnector.cs
Normal file
33
src/ElectronNET.API/BridgeConnector.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace ElectronNET.API
|
||||
{
|
||||
internal static class BridgeConnector
|
||||
{
|
||||
private static SocketIoFacade _socket;
|
||||
private static readonly object SyncRoot = new();
|
||||
|
||||
public static SocketIoFacade Socket
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_socket == null)
|
||||
{
|
||||
lock (SyncRoot)
|
||||
{
|
||||
if (_socket == null)
|
||||
{
|
||||
|
||||
string socketUrl = HybridSupport.IsElectronActive
|
||||
? $"http://localhost:{BridgeSettings.SocketPort}"
|
||||
: "http://localhost";
|
||||
|
||||
_socket = new SocketIoFacade(socketUrl);
|
||||
_socket.Connect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _socket;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user