Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a2e44a0
feat(logging): use `NullLoggerFactory` on Release config
Redouane64 Aug 18, 2024
c589035
feat(transport): use `MemoryPool` to buffer received messages
Redouane64 Aug 24, 2024
5e38481
feat: prototype packet types and structure
Redouane64 Aug 24, 2024
63f0cce
feat: prototype client API surface
Redouane64 Aug 25, 2024
b4ddad8
feat: make namespace as the last optional argument in `SendAsync` met…
Redouane64 Sep 1, 2024
590a1b3
chore: add TODO
Redouane64 Sep 27, 2024
f6bf4cb
feat: add socket.io packet serializer
Redouane64 Sep 27, 2024
c9eda14
chore: expose assembly to tests
Redouane64 Sep 27, 2024
c3e506b
chore: clean up
Redouane64 Sep 27, 2024
56715c5
feat: fix usings, clean up and add TODOs
Redouane64 Sep 28, 2024
772ccf0
feat: refactor packet serialization and send implementation
Redouane64 Sep 28, 2024
32722da
fix: fix tests and samples
Redouane64 Sep 30, 2024
79d6424
feat(socket.io): refactoring and documentation
Redouane64 Sep 30, 2024
b7dbd02
feat: add socket.io server and update npm setup
Redouane64 Sep 30, 2024
429cec5
feat: add packets serialization and tests
Redouane64 Oct 1, 2024
4aedc02
chore: make fields nullable
Redouane64 Oct 1, 2024
9776549
feat: add `Path` parameter and refactor `Send` methods
Redouane64 Oct 1, 2024
b512875
feat: add more packet construction tests and fix namespace handling
Redouane64 Oct 1, 2024
c515cae
feat: add negative test cases
Redouane64 Oct 1, 2024
7efb850
fix: fix binary payload check and add negative test cases
Redouane64 Oct 1, 2024
9014e8e
fix: set default event name and add ack response
Redouane64 Oct 1, 2024
9665e02
fix: check packet type on `AddItem` for binary data
Redouane64 Oct 1, 2024
a593220
fix: set default event value, update Binary packet construction logic
Redouane64 Oct 2, 2024
27cd312
test: add Ack packet tests
Redouane64 Oct 2, 2024
3092690
test: add binary events tests
Redouane64 Oct 2, 2024
c3830ee
chore: make IPacketData impls classes and make `Event` property nullable
Redouane64 Oct 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions SocketIO.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D8B5DE1E
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EngineIO.Client.Tests", "tests\EngineIO.Client.Tests\EngineIO.Client.Tests.csproj", "{5D824F05-5793-4768-99DF-E4D993F16B75}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIO.Client", "src\SocketIO.Client\SocketIO.Client.csproj", "{222889F5-6A36-4A8A-8C78-A910E40D4F82}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketIO.Client.Tests", "tests\SocketIO.Client.Tests\SocketIO.Client.Tests.csproj", "{E0C636E7-91B0-44AE-9752-F08326C7C5F2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -36,10 +40,20 @@ Global
{5D824F05-5793-4768-99DF-E4D993F16B75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D824F05-5793-4768-99DF-E4D993F16B75}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D824F05-5793-4768-99DF-E4D993F16B75}.Release|Any CPU.Build.0 = Release|Any CPU
{222889F5-6A36-4A8A-8C78-A910E40D4F82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{222889F5-6A36-4A8A-8C78-A910E40D4F82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{222889F5-6A36-4A8A-8C78-A910E40D4F82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{222889F5-6A36-4A8A-8C78-A910E40D4F82}.Release|Any CPU.Build.0 = Release|Any CPU
{E0C636E7-91B0-44AE-9752-F08326C7C5F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0C636E7-91B0-44AE-9752-F08326C7C5F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0C636E7-91B0-44AE-9752-F08326C7C5F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0C636E7-91B0-44AE-9752-F08326C7C5F2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D1C745FE-52AF-4145-8243-9FCA91BE7916} = {80C612B0-98E1-4E6B-AF10-5BB3087F0864}
{4F6177C5-3234-4897-B61C-49C44D3E2EF8} = {577735D4-BC7E-464A-BC9B-93AD8B5B6738}
{5D824F05-5793-4768-99DF-E4D993F16B75} = {D8B5DE1E-C83F-40A9-9D27-D2FBB3866F0A}
{222889F5-6A36-4A8A-8C78-A910E40D4F82} = {577735D4-BC7E-464A-BC9B-93AD8B5B6738}
{E0C636E7-91B0-44AE-9752-F08326C7C5F2} = {D8B5DE1E-C83F-40A9-9D27-D2FBB3866F0A}
EndGlobalSection
EndGlobal
175 changes: 135 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"description": "Socket.IO .NET client samples test server and tools",
"directories": {},
"scripts": {
"start:server": "npm start -w samples/simple-engine-io-server"
"start:engine": "npm start -w samples/simple-engine-io-server",
"start:socket": "npm start -w samples/simple-socket-io-server"
},
"author": "Redhouane Sobaihi",
"license": "ISC",
"workspaces": [
"samples/simple-engine-io-server"
"samples/simple-engine-io-server",
"samples/simple-socket-io-server"
]
}
14 changes: 12 additions & 2 deletions samples/PingPong/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@
using EngineIO.Client;

using Microsoft.Extensions.Logging;
#if DEBUG
using Microsoft.Extensions.Logging.Console;
#else
using Microsoft.Extensions.Logging.Abstractions;
#endif

namespace PingPong;

internal class Program : IDisposable
{
private readonly ILoggerFactory loggerFactory;
private readonly ILogger<Program> logger;
private static readonly CancellationTokenSource cts = new();

Program()
{
#if DEBUG
var loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddSimpleConsole(o =>
Expand All @@ -26,8 +32,12 @@ internal class Program : IDisposable
o.ColorBehavior = LoggerColorBehavior.Enabled;
}).SetMinimumLevel(LogLevel.Debug);
});

logger = loggerFactory.CreateLogger<Program>();
#else
this.loggerFactory = NullLoggerFactory.Instance;
this.logger = loggerFactory.CreateLogger<Program>();
#endif
Engine = new Engine((options) =>
{
options.BaseAddress = "http://127.0.0.1:9854";
Expand All @@ -48,7 +58,7 @@ private static async Task Main(string[] args)
program.logger.LogDebug("Client Starting...");

await program.Engine.ConnectAsync(cts.Token);
await Task.WhenAll(Task.Run(program.EmitAsync), Task.Run(program.ListenAsync));
await Task.WhenAll(Task.Run(program.EmitAsync, cts.Token), Task.Run(program.ListenAsync, cts.Token));

program.logger.LogDebug("Disconnecting...");
await program.Engine.DisconnectAsync();
Expand Down
Loading