SocketIOClient 2.0.2.4
See the version list below for details.
dotnet add package SocketIOClient --version 2.0.2.4
NuGet\Install-Package SocketIOClient -Version 2.0.2.4
<PackageReference Include="SocketIOClient" Version="2.0.2.4" />
<PackageVersion Include="SocketIOClient" Version="2.0.2.4" />
<PackageReference Include="SocketIOClient" />
paket add SocketIOClient --version 2.0.2.4
#r "nuget: SocketIOClient, 2.0.2.4"
#:package SocketIOClient@2.0.2.4
#addin nuget:?package=SocketIOClient&version=2.0.2.4
#tool nuget:?package=SocketIOClient&version=2.0.2.4
Socket.IO-client for .NET
An elegant socket.io client for .NET
How to use
If your TargetFramework is .NET Framework and it runs on Windows7/Windows Server 2008 R2, please install
Otherwise, we recommend you to install
Example of usage
Emit an event
Client:
var client = new SocketIO("http://localhost:11000/");
client.On("hi", response =>
{
string text = response.GetValue<string>();
});
client.OnConnected += async (sender, e) =>
{
await client.EmitAsync("hi", ".net core");
};
await client.ConnectAsync();
Server:
socket.on("hi", name => {
socket.emit("hi", `hi ${name}, You are connected to the server`);
});
Emit with Ack
Client:
var client = new SocketIO("http://localhost:11000/");
client.OnConnected += async (sender, e) =>
{
await client.EmitAsync("ack", response =>
{
result = response.GetValue();
}, ".net core");
};
await client.ConnectAsync();
Server:
socket.on("ack", (name, fn) => {
fn({
result: true,
message: `ack(${name})`
});
});
Emit with Binary
Client:
var client = new SocketIO("http://localhost:11000/");
client.OnConnected += async (sender, e) =>
{
await client.EmitAsync("bytes", name, new
{
source = "client001",
bytes = Encoding.UTF8.GetBytes(".net core")
});
};
client.On("bytes", response =>
{
var result = response.GetValue<ByteResponse>();
});
await client.ConnectAsync();
class ByteResponse
{
public string ClientSource { get; set; }
public string Source { get; set; }
[JsonProperty("bytes")]
public byte[] Buffer { get; set; }
}
Server:
socket.on("bytes", (name, data) => {
const bytes = Buffer.from(data.bytes.toString() + " - server - " + name, "utf-8");
socket.emit("bytes", {
clientSource: data.source,
source: "server",
bytes
});
});
Get multiple response values
Client:
var client = new SocketIO("http://localhost:11000/");
client.OnConnected += async (sender, e) =>
{
await client.EmitAsync("change", new
{
code = 200,
message = "val1"
}, "val2");
};
client.On("change", response =>
{
// You can get the JSON string of the response by calling response.ToString()
// After that you can decide how to parse the response data.
// For example: ["val2", { "code": 200, "message": "val1" }]
string resVal1 = response.GetValue<string>();
ChangeResponse resVal2 = response.GetValue<ChangeResponse>(1);
// If you don't want to create a model, you can parse it like this
string message = response.GetValue(1).Value<string>("message");
int code = response.GetValue(1).Value<int>("code");
// More specific usage: https://github.com/jamesnk/newtonsoft.json
});
await client.ConnectAsync();
class ChangeResponse
{
public int Code { get; set; }
public string Message { get; set; }
}
Server:
socket.on("change", (val1, val2) => {
socket.emit("change", val2, val1);
})
More examples
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 12.0.3)
- System.Collections (>= 4.3.0)
NuGet packages (44)
Showing the top 5 NuGet packages that depend on SocketIOClient:
| Package | Downloads |
|---|---|
|
ElectronNET.API
Building cross platform electron based desktop apps with .NET Core and ASP.NET Core. This package contains the API to access the "native" electron API. |
|
|
SocketIOClient.Newtonsoft.Json
socket.io-client json serialization/deserialization for Newtonsoft.Json |
|
|
DigitalRuby.ExchangeSharp
ExchangeSharp is a C# API for working with various cryptocurrency exchanges. Web sockets are also supported for some exchanges. |
|
|
Backendless.NET
Backendless is a cloud-based serverless platform which significantly simplifies the process of development of web and mobile applications. This SDK provides the client-side APIs which you can use in your app to take advantage of the Backendless platform functionality. Your application can rely on Backendless for the following functions: Backendless has a ton of awesome functionality including: - Real-time Database - Real-time Publish/Subscribe Messaging - User Management (user registration, login, logout, password recovery) - Push Notification - File operations (upload, download, copy, move, delete) - Geo location All the APIs can be secured with roles-based security. Also, you can create your own API services and deploy them into Backendless. |
|
|
SecTester.Repeater
This SDK is designed to provide all the basic tools and functions that will allow you to easily integrate the Bright security testing engine into your own project. |
GitHub repositories (9)
Showing the top 9 popular GitHub repositories that depend on SocketIOClient:
| Repository | Stars |
|---|---|
|
ElectronNET/Electron.NET
:electron: Build cross platform desktop apps with ASP.NET Core (Razor Pages, MVC, Blazor).
|
|
|
ArduPilot/MissionPlanner
Mission Planner Ground Control Station for ArduPilot (c# .net)
|
|
|
visualHFT/VisualHFT
VisualHFT is a WPF/C# desktop GUI that shows market microstructure in real time. You can track advanced limit‑order‑book dynamics and execution quality, then use its modular plugins to shape the analysis to your workflow.
|
|
|
DigitalRuby/ExchangeSharp
ExchangeSharp is a powerful, fast and easy to use .NET/C# API for interfacing with many crypto currency exchanges. REST and web sockets are supported.
|
|
|
thanhkeke97/RSTGameTranslation
🎮 Real-time Game Translation Tool | OCR + AI Translation | Windows Gaming | Open Source
|
|
|
automuteus/amonguscapture
Capture of the local Among Us executable state
|
|
|
DeSinc/SallyBot
AI Chatbot coded in Discord.net C#
|
|
|
jensroth-git/WinLaunch
macOS Launchpad for Windows
|
|
|
songify-rocks/Songify
A simple tool that gets the current track from Spotify, YouTube and Nightbot.
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 3.1.2 | 326,690 | 8/18/2024 | |
| 3.1.1 | 201,282 | 9/5/2023 | |
| 3.1.0 | 1,845 | 8/27/2023 | |
| 3.0.8 | 393,866 | 3/4/2023 | |
| 3.0.7 | 35,796 | 11/29/2022 | |
| 3.0.7-alpha.3 | 221 | 11/29/2022 | |
| 3.0.7-alpha.2 | 264 | 11/29/2022 | |
| 3.0.7-alpha.1 | 336 | 11/6/2022 | |
| 3.0.6 | 245,412 | 3/17/2022 | |
| 3.0.5 | 54,348 | 1/12/2022 | |
| 3.0.4 | 35,984 | 12/6/2021 | |
| 3.0.4-alpha.1 | 389 | 11/18/2021 | |
| 3.0.3 | 18,449 | 9/24/2021 | |
| 3.0.2 | 1,521 | 9/22/2021 | |
| 3.0.1 | 763 | 9/18/2021 | |
| 3.0.0 | 6,320 | 9/13/2021 | |
| 2.3.1 | 47,937 | 8/3/2021 | |
| 2.3.0 | 4,087 | 7/22/2021 | |
| 2.2.4 | 57,472 | 6/24/2021 | |
| 2.2.3 | 2,929 | 6/15/2021 | |
| 2.2.2 | 1,729 | 6/7/2021 | |
| 2.2.1 | 1,825 | 6/5/2021 | |
| 2.2.1-alpha.1 | 368 | 6/4/2021 | |
| 2.2.0 | 16,079 | 4/29/2021 | |
| 2.1.8-alpha-0 | 491 | 4/1/2021 | |
| 2.1.7 | 20,575 | 3/24/2021 | |
| 2.1.6 | 3,953 | 3/11/2021 | |
| 2.1.5 | 22,171 | 2/5/2021 | |
| 2.1.4 | 758 | 2/5/2021 | |
| 2.1.3 | 19,402 | 1/13/2021 | |
| 2.1.2 | 1,672 | 12/23/2020 | |
| 2.1.1 | 10,528 | 11/13/2020 | |
| 2.1.0 | 4,215 | 11/12/2020 | |
| 2.1.0-alpha.1 | 506 | 11/10/2020 | |
| 2.0.2.9 | 4,544 | 10/27/2020 | |
| 2.0.2.8 | 1,091 | 10/25/2020 | |
| 2.0.2.7 | 12,206 | 10/9/2020 | |
| 2.0.2.6 | 196,735 | 9/9/2020 | |
| 2.0.2.5 | 1,274 | 9/8/2020 | |
| 2.0.2.4 | 13,832 | 8/14/2020 | |
| 2.0.2.3 | 2,435 | 7/22/2020 | |
| 2.0.2.2 | 1,296 | 7/11/2020 | |
| 2.0.2.1 | 73,424 | 6/18/2020 | |
| 2.0.2.1-alpha.2 | 663 | 6/16/2020 | |
| 2.0.2.1-alpha.1 | 649 | 6/15/2020 | |
| 2.0.2 | 4,215 | 6/15/2020 | |
| 2.0.2-alpha.2 | 671 | 6/10/2020 | |
| 2.0.2-alpha.1 | 674 | 6/10/2020 | |
| 2.0.1 | 3,104 | 6/2/2020 | |
| 2.0.1-alpha.5 | 699 | 6/1/2020 | |
| 2.0.1-alpha.4 | 771 | 5/30/2020 | |
| 2.0.1-alpha.3 | 684 | 5/30/2020 | |
| 2.0.1-alpha.2 | 2,728 | 5/29/2020 | |
| 2.0.1-alpha.1 | 699 | 5/29/2020 | |
| 2.0.0 | 32,126 | 5/21/2020 | |
| 2.0.0-beta.3 | 677 | 5/21/2020 | |
| 2.0.0-beta.2 | 681 | 5/21/2020 | |
| 2.0.0-beta.1 | 751 | 5/18/2020 | |
| 2.0.0-alpha-2 | 843 | 5/16/2020 | |
| 2.0.0-alpha | 748 | 5/15/2020 | |
| 1.0.3.13 | 3,724 | 5/8/2020 | |
| 1.0.3.13-alpha | 839 | 5/7/2020 | |
| 1.0.3.12 | 5,860 | 4/10/2020 | |
| 1.0.3.11 | 1,076 | 4/9/2020 | |
| 1.0.3.10 | 1,052 | 4/8/2020 | |
| 1.0.3.9 | 1,296 | 4/7/2020 | |
| 1.0.3.8 | 15,186 | 3/17/2020 | |
| 1.0.3.7 | 1,079 | 3/17/2020 | |
| 1.0.3.6 | 1,097 | 3/16/2020 | |
| 1.0.3.5 | 1,028 | 3/16/2020 | |
| 1.0.3.4 | 1,003 | 3/16/2020 | |
| 1.0.3.3 | 1,632 | 3/8/2020 | |
| 1.0.3.2 | 1,007 | 3/7/2020 | |
| 1.0.3.1 | 1,023 | 3/7/2020 | |
| 1.0.3 | 1,185 | 3/2/2020 | |
| 1.0.2.7 | 1,472 | 2/13/2020 | |
| 1.0.2.6 | 2,746 | 10/21/2019 | |
| 1.0.2.5 | 1,263 | 9/14/2019 | |
| 1.0.2.4 | 1,123 | 9/8/2019 | |
| 1.0.2.3 | 1,102 | 8/27/2019 | |
| 1.0.2.2 | 1,080 | 8/26/2019 | |
| 1.0.2.1 | 1,075 | 8/21/2019 | |
| 1.0.2 | 1,139 | 8/21/2019 | |
| 1.0.1 | 1,165 | 8/7/2019 | |
| 1.0.0 | 1,590 | 8/6/2019 |