WebSocket4Net 1.0.0-beta.4

WebSocket4Net

build MyGet Version NuGet Beta Version NuGet Version NuGet Badge

A popular .NET WebSocket Client

This new version is built on SuperSocket 2.0 and modern .NET (.NET Core). It includes breaking changes from the previous WebSocket4Net version, so code adjustments may be necessary for upgrading.

Usage 1: Read messages from event handler.


using WebSocket4Net;

var websocket = new WebSocket("https://localhost/live");

websocket.PackageHandler += (sender, package) =>
{
    Console.WriteLine(package.Message);
}

await websocket.OpenAsync();

websocket.StartReceive();

await websocket.SendAsync("Hello");

//...

await websocket.CloseAsync();

Usage 1: Read messages on demand.


using WebSocket4Net;

var websocket = new WebSocket("https://localhost/live");

await websocket.OpenAsync();

await websocket.SendAsync("Hello");

while (true)
{
    var package = await websocket.ReceiveAsync();

    if (package == null)
        break;

    Console.WriteLine(package.Message);
}

//...

await websocket.CloseAsync();

Showing the top 20 packages that depend on WebSocket4Net.

Packages Downloads
SocketIoClientDotNet
This is the Socket.IO Client Library for .NET.
101
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
79
SocketIoClientDotNet
This is the Socket.IO Client Library for .NET.
65
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
64
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
63
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
63
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
62
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
61
SocketIoClientDotNet
This is the Socket.IO Client Library for .NET.
61
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
60
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
60
SocketIoClientDotNet
This is the Socket.IO Client Library for .NET.
59
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
59
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
58
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
58

.NET 5.0

.NET Standard 2.1

.NET 8.0

.NET 8.0

.NET 8.0

.NET 8.0

.NET 8.0

.NET 7.0

.NET 7.0

.NET 7.0

.NET 7.0

.NET 7.0

.NET 6.0

Version Downloads Last updated
1.0.0-beta.5 46 11/11/2024
1.0.0-beta.4 46 09/03/2024
1.0.0-beta.3 52 07/02/2024
1.0.0-beta.2 44 06/10/2024
1.0.0-beta.1 50 06/03/2024
0.15.2 56 11/10/2021
0.15.1 66 11/09/2020
0.15.0 63 09/13/2022
0.15.0-beta9 56 02/26/2023
0.15.0-beta8 59 02/07/2023
0.15.0-beta7 52 02/07/2023
0.15.0-beta6 57 05/28/2022
0.15.0-beta5 63 07/16/2022
0.15.0-beta4 52 05/17/2022
0.15.0-beta3 60 02/26/2023
0.15.0-beta2 48 08/24/2023
0.15.0-beta1 53 05/27/2022
0.14.1 46 02/07/2023
0.14.0 51 02/25/2023
0.13.1 50 02/07/2023
0.13.0 59 11/23/2022
0.12.0 59 05/17/2022
0.11.0 74 06/30/2022
0.10.0 59 02/25/2023
0.9.0 55 07/09/2022
0.8.0 60 10/27/2022
0.7.0 51 06/03/2022
0.5.1 61 09/10/2022
0.4.0 51 08/24/2023