SocketIOClient 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package SocketIOClient --version 1.0.2
NuGet\Install-Package SocketIOClient -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SocketIOClient" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SocketIOClient --version 1.0.2
#r "nuget: SocketIOClient, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SocketIOClient as a Cake Addin
#addin nuget:?package=SocketIOClient&version=1.0.2

// Install SocketIOClient as a Cake Tool
#tool nuget:?package=SocketIOClient&version=1.0.2

Socket.IO-client C#

This is the Socket.IO client for C#, which is base on ClientWebSocket, provide a simple way to connect to the Socket.IO server. The target framework is .NET Standard 2.0

Usage

var client = new SocketIO("http://localhost:3000")
{
    // if server need some parameters, you can add to here
    Parameters = new Dictionary<string, string>
    {
        { "uid", "" },
        { "token", "" }
    }
}

client.OnClosed += Client_OnClosed;
client.OnConnected += Client_OnConnected;

// Listen server events
client.On("test", res =>
{
    Console.WriteLine(res.Text);
    // Next, you might parse the data in this way.
    var obj = JsonConvert.DeserializeObject<T>(res.Text);
	// Or, read some fields
    var jobj = JObject.Parse(res.Text);
    int code = jobj.Value<int>("code");
    bool hasMore = jobj["data"].Value<bool>("hasMore");
    var data = jobj["data"].ToObject<ResponseData>();
    // ...
});

// Connect to the server
await client.ConnectAsync();

// Emit test event, send string.
await client.EmitAsync("test", "EmitTest");

// Emit test event, send object.
await client.EmitAsync("test", new { code = 200 });

// ...

private void Client_OnConnected()
{
    Console.WriteLine("Connected to server");
}

private async void Client_OnClosed()
{
    if (reason == ServerCloseReason.ClosedByServer)
    {
        // ...
    }
    else if (reason == ServerCloseReason.Aborted)
    {
        for (int i = 0; i < 3; i++)
        {
            try
            {
                await client.ConnectAsync();
                break;
            }
            catch (WebSocketException ex)
            {
                // show tips
                Console.WriteLine(ex.Message);
                await Task.Delay(2000);
            }
        }
        // show tips
        Console.WriteLine("Tried to reconnect 3 times, unable to connect to the server");
    }
}
Product 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. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (35)

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.

DigitalRuby.ExchangeSharp

ExchangeSharp is a C# API for working with various cryptocurrency exchanges. Web sockets are also supported for some exchanges.

SocketIOClient.Newtonsoft.Json

socket.io-client json serialization/deserialization for Newtonsoft.Json

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 (6)

Showing the top 5 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)
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.
silahian/VisualHFT
VisualHFT is a cutting-edge GUI platform for market analysis, focusing on real-time visualization of market microstructure. Built with WPF & C#, it displays key metrics like Limit Order Book dynamics and execution quality. Its modular design ensures adaptability for developers and traders, enabling tailored analytical solutions.
automuteus/amonguscapture
Capture of the local Among Us executable state
Version Downloads Last updated
3.1.1 47,062 9/5/2023
3.1.0 612 8/27/2023
3.0.8 151,947 3/4/2023
3.0.7 28,820 11/29/2022
3.0.7-alpha.3 91 11/29/2022
3.0.7-alpha.2 101 11/29/2022
3.0.7-alpha.1 194 11/6/2022
3.0.6 156,770 3/17/2022
3.0.5 39,034 1/12/2022
3.0.4 20,504 12/6/2021
3.0.4-alpha.1 207 11/18/2021
3.0.3 16,155 9/24/2021
3.0.2 989 9/22/2021
3.0.1 471 9/18/2021
3.0.0 1,972 9/13/2021
2.3.1 31,247 8/3/2021
2.3.0 2,917 7/22/2021
2.2.4 23,432 6/24/2021
2.2.3 2,387 6/15/2021
2.2.2 1,445 6/7/2021
2.2.1 1,493 6/5/2021
2.2.1-alpha.1 196 6/4/2021
2.2.0 14,279 4/29/2021
2.1.8-alpha-0 265 4/1/2021
2.1.7 17,659 3/24/2021
2.1.6 3,560 3/11/2021
2.1.5 19,541 2/5/2021
2.1.4 423 2/5/2021
2.1.3 11,790 1/13/2021
2.1.2 1,362 12/23/2020
2.1.1 7,808 11/13/2020
2.1.0 824 11/12/2020
2.1.0-alpha.1 303 11/10/2020
2.0.2.9 3,588 10/27/2020
2.0.2.8 747 10/25/2020
2.0.2.7 9,854 10/9/2020
2.0.2.6 195,512 9/9/2020
2.0.2.5 1,040 9/8/2020
2.0.2.4 12,883 8/14/2020
2.0.2.3 2,050 7/22/2020
2.0.2.2 1,052 7/11/2020
2.0.2.1 49,818 6/18/2020
2.0.2.1-alpha.2 365 6/16/2020
2.0.2.1-alpha.1 345 6/15/2020
2.0.2 3,398 6/15/2020
2.0.2-alpha.2 351 6/10/2020
2.0.2-alpha.1 350 6/10/2020
2.0.1 2,851 6/2/2020
2.0.1-alpha.5 371 6/1/2020
2.0.1-alpha.4 441 5/30/2020
2.0.1-alpha.3 353 5/30/2020
2.0.1-alpha.2 2,400 5/29/2020
2.0.1-alpha.1 394 5/29/2020
2.0.0 31,626 5/21/2020
2.0.0-beta.3 368 5/21/2020
2.0.0-beta.2 366 5/21/2020
2.0.0-beta.1 425 5/18/2020
2.0.0-alpha-2 490 5/16/2020
2.0.0-alpha 420 5/15/2020
1.0.3.13 3,174 5/8/2020
1.0.3.13-alpha 494 5/7/2020
1.0.3.12 5,473 4/10/2020
1.0.3.11 703 4/9/2020
1.0.3.10 692 4/8/2020
1.0.3.9 931 4/7/2020
1.0.3.8 2,297 3/17/2020
1.0.3.7 700 3/17/2020
1.0.3.6 702 3/16/2020
1.0.3.5 668 3/16/2020
1.0.3.4 637 3/16/2020
1.0.3.3 1,225 3/8/2020
1.0.3.2 649 3/7/2020
1.0.3.1 677 3/7/2020
1.0.3 796 3/2/2020
1.0.2.7 1,114 2/13/2020
1.0.2.6 2,362 10/21/2019
1.0.2.5 899 9/14/2019
1.0.2.4 736 9/8/2019
1.0.2.3 748 8/27/2019
1.0.2.2 702 8/26/2019
1.0.2.1 721 8/21/2019
1.0.2 728 8/21/2019
1.0.1 777 8/7/2019
1.0.0 876 8/6/2019