Skip to content

Commit d1e8584

Browse files
committed
Removed SignalR
1 parent 7837b69 commit d1e8584

25 files changed

+55
-1676
lines changed
File renamed without changes.

docs/SignalR-Implementation-Summary.md

Lines changed: 0 additions & 450 deletions
This file was deleted.

docs/SignalR-Startup-Mode.md

Lines changed: 0 additions & 236 deletions
This file was deleted.

src/ElectronNET.API/Bridge/ISocketConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace ElectronNET.API.Bridge
44
using System.Threading.Tasks;
55

66
/// <summary>
7-
/// Common interface for communication facades (SocketIO and SignalR).
7+
/// Common interface for communication facades.
88
/// Provides methods for bidirectional communication between .NET and Electron.
99
/// </summary>
1010
internal interface ISocketConnection : IDisposable

src/ElectronNET.API/Bridge/SocketIOConnection.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,29 @@
33
namespace ElectronNET.API;
44

55
using System;
6+
using System.Collections.Generic;
67
using System.Threading.Tasks;
78
using ElectronNET.API.Bridge;
89
using ElectronNET.API.Serialization;
910
using SocketIO.Serializer.SystemTextJson;
1011
using SocketIO = SocketIOClient.SocketIO;
12+
using SocketIOOptions = SocketIOClient.SocketIOOptions;
1113

1214
internal class SocketIOConnection : ISocketConnection
1315
{
1416
private readonly SocketIO _socket;
1517
private readonly object _lockObj = new object();
1618
private bool _isDisposed;
1719

18-
public SocketIOConnection(string uri)
20+
public SocketIOConnection(string uri, string authorization)
1921
{
20-
_socket = new SocketIO(uri);
22+
_socket = new SocketIO(uri, new SocketIOOptions
23+
{
24+
ExtraHeaders = new Dictionary<string, string>
25+
{
26+
["authorization"] = authorization
27+
},
28+
});
2129
_socket.Serializer = new SystemTextJsonSerializer(ElectronJson.Options);
2230
// Use default System.Text.Json serializer from SocketIOClient.
2331
// Outgoing args are normalized to camelCase via SerializeArg in Emit.

src/ElectronNET.API/Common/Extensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public static bool IsUnpackaged(this StartupMethod method)
1414
{
1515
case StartupMethod.UnpackedElectronFirst:
1616
case StartupMethod.UnpackedDotnetFirst:
17-
case StartupMethod.UnpackedDotnetFirstSignalR:
1817
return true;
1918
default:
2019
return false;

src/ElectronNET.API/Runtime/Controllers/RuntimeControllerDotNetFirst.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected override Task StartCore()
6565
private void ElectronProcess_Ready(object sender, EventArgs e)
6666
{
6767
this.TransitionState(LifetimeState.Started);
68-
this.socketBridge = new SocketBridgeService(this.port!.Value);
68+
this.socketBridge = new SocketBridgeService(this.port!.Value, "");
6969
this.socketBridge.Ready += this.SocketBridge_Ready;
7070
this.socketBridge.Stopped += this.SocketBridge_Stopped;
7171
this.socketBridge.Start();

src/ElectronNET.API/Runtime/Controllers/RuntimeControllerElectronFirst.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected override Task StartCore()
4949
}
5050

5151
this.TransitionState(LifetimeState.Starting);
52-
this.socketBridge = new SocketBridgeService(this.port!.Value);
52+
this.socketBridge = new SocketBridgeService(this.port!.Value, "");
5353
this.socketBridge.Ready += this.SocketBridge_Ready;
5454
this.socketBridge.Stopped += this.SocketBridge_Stopped;
5555
this.socketBridge.Start();

src/ElectronNET.API/Runtime/Data/StartupMethod.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,5 @@ public enum StartupMethod
3333
/// On the command lines, this is "unpackeddotnet"
3434
/// </remarks>
3535
UnpackedDotnetFirst,
36-
37-
/// <summary>Packaged Electron app where DotNet launches Electron and uses SignalR for communication.</summary>
38-
/// <remarks>
39-
/// DotNet starts first on port 0 (dynamic), launches Electron with the actual URL,
40-
/// and uses SignalR instead of socket.io for bidirectional communication.
41-
/// Optimized for Blazor Server scenarios. ASP.NET Core only.
42-
/// On the command lines, this is "dotnetpackedsignalr"
43-
/// </remarks>
44-
PackagedDotnetFirstSignalR,
45-
46-
/// <summary>Unpackaged execution where DotNet launches Electron and uses SignalR for communication.</summary>
47-
/// <remarks>
48-
/// Similar to PackagedDotnetFirstSignalR but for debugging scenarios.
49-
/// DotNet starts first on port 0 (dynamic), launches Electron with the actual URL,
50-
/// and uses SignalR instead of socket.io for bidirectional communication.
51-
/// On the command lines, this is "unpackeddotnetsignalr"
52-
/// </remarks>
53-
UnpackedDotnetFirstSignalR,
5436
}
5537
}

src/ElectronNET.API/Runtime/Services/SocketBridge/SocketBridgeService.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
internal class SocketBridgeService : LifetimeServiceBase
99
{
1010
private readonly int socketPort;
11+
private readonly string authorization;
1112
private readonly string socketUrl;
1213
private SocketIOConnection socket;
1314

14-
public SocketBridgeService(int socketPort)
15+
public SocketBridgeService(int socketPort, string authorization)
1516
{
1617
this.socketPort = socketPort;
18+
this.authorization = authorization;
1719
this.socketUrl = $"http://localhost:{this.socketPort}";
1820
}
1921

@@ -23,7 +25,7 @@ public SocketBridgeService(int socketPort)
2325

2426
protected override Task StartCore()
2527
{
26-
this.socket = new SocketIOConnection(this.socketUrl);
28+
this.socket = new SocketIOConnection(this.socketUrl, this.authorization);
2729
this.socket.BridgeConnected += this.Socket_BridgeConnected;
2830
this.socket.BridgeDisconnected += this.Socket_BridgeDisconnected;
2931
Task.Run(this.Connect);

0 commit comments

Comments
 (0)