All Projects → PingmanTools → System.Net.WebSockets.Client.Managed

PingmanTools / System.Net.WebSockets.Client.Managed

Licence: MIT license
Microsoft's managed implementation of System.Net.WebSockets.ClientWebSocket tweaked for use on Windows 7 and .NET 4.5

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to System.Net.WebSockets.Client.Managed

Websocat
Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
Stars: ✭ 3,477 (+8380.49%)
Mutual labels:  websockets, websocket-client
Php Wss
Web-socket server/client with multi-process and parse templates support on server and send/receive options on client
Stars: ✭ 117 (+185.37%)
Mutual labels:  websockets, websocket-client
Sockpuppet
Having fun with WebSockets, Python, Golang and nytimes.com
Stars: ✭ 32 (-21.95%)
Mutual labels:  websockets, websocket-client
Starscream
Websockets in swift for iOS and OSX
Stars: ✭ 7,105 (+17229.27%)
Mutual labels:  websockets, websocket-client
Claws
Awesome WebSocket CLient - an interactive command line client for testing websocket servers
Stars: ✭ 187 (+356.1%)
Mutual labels:  websockets, websocket-client
Awesome Websockets
A curated list of Websocket libraries and resources.
Stars: ✭ 850 (+1973.17%)
Mutual labels:  websockets, websocket-client
Arduinowebsockets
arduinoWebSockets
Stars: ✭ 1,265 (+2985.37%)
Mutual labels:  websockets, websocket-client
Java Slack Sdk
Slack Developer Kit (including Bolt for Java) for any JVM language
Stars: ✭ 393 (+858.54%)
Mutual labels:  websockets, websocket-client
Osc Js
OSC library for Node.js, Electron, Chrome Apps, Webpages or any other JS application. It comes with a customizable Plugin API for WebSocket, UDP or bridge networking
Stars: ✭ 135 (+229.27%)
Mutual labels:  websockets, websocket-client
Bolt Js
A framework to build Slack apps using JavaScript
Stars: ✭ 1,971 (+4707.32%)
Mutual labels:  websockets, websocket-client
Gun
HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP.
Stars: ✭ 710 (+1631.71%)
Mutual labels:  websockets, websocket-client
Ixwebsocket
websocket and http client and server library, coming with ws, a command line swiss army knife utility
Stars: ✭ 204 (+397.56%)
Mutual labels:  websockets, websocket-client
Ulfius
Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language. Can stream large amount of data, integrate JSON data with Jansson, and create websocket services
Stars: ✭ 666 (+1524.39%)
Mutual labels:  websockets, websocket-client
Stl.fusion
Get real-time UI updates in Blazor apps and 10-1000x faster API responses with a novel approach to distributed reactive computing. Fusion brings computed observables and automatic dependency tracking from Knockout.js/MobX/Vue to the next level by enabling a single dependency graph span multiple servers and clients, including Blazor apps running in browser.
Stars: ✭ 858 (+1992.68%)
Mutual labels:  websockets, websocket-client
Pawl
Asynchronous WebSocket client
Stars: ✭ 448 (+992.68%)
Mutual labels:  websockets, websocket-client
Achilles
A Simple Retrofit Inspired Android Websocket Client (In Development)
Stars: ✭ 37 (-9.76%)
Mutual labels:  websockets, websocket-client
Websockets
Library for building WebSocket servers and clients in Python
Stars: ✭ 3,724 (+8982.93%)
Mutual labels:  websockets, websocket-client
Saea
SAEA.Socket is a high-performance IOCP framework TCP based on dotnet standard 2.0; Src contains its application test scenarios, such as websocket,rpc, redis driver, MVC WebAPI, lightweight message server, ultra large file transmission, etc. SAEA.Socket是一个高性能IOCP框架的 TCP,基于dotnet standard 2.0;Src中含有其应用测试场景,例如websocket、rpc、redis驱动、MVC WebAPI、轻量级消息服务器、超大文件传输等
Stars: ✭ 318 (+675.61%)
Mutual labels:  websockets, websocket-client
Fs2 Http
Http Server and client using fs2
Stars: ✭ 132 (+221.95%)
Mutual labels:  websockets, websocket-client
Bolt Python
A framework to build Slack apps using Python
Stars: ✭ 190 (+363.41%)
Mutual labels:  websockets, websocket-client

System.Net.WebSockets.Client.Managed

Microsoft's managed implementation of System.Net.WebSockets.ClientWebSocket tweaked for use on Windows 7 and .NET 4.5


From Microsoft's ClientWebSocket documentation

Some of the classes and class elements in the System.Net.WebSockets namespace are supported on Windows 7, Windows Vista SP2, and Windows Server 2008. However, the only public implementations of client and server WebSockets are supported on Windows 8 and Windows Server 2012. The class elements in the System.Net.WebSockets namespace that are supported on Windows 7, Windows Vista SP2, and Windows Server 2008 are abstract class elements. This allows an application developer to inherit and extend these abstract class classes and class elements with an actual implementation of client WebSockets.

In other words: on a Windows 7 machine calling new System.Net.WebSockets.ClientWebSocket() throws a PlatformNotSupportedException.

Thankfully Microsoft did implement that abstract class in managed code for use on non-Windows systems! But its only available for .NET 4.6+

This project is the managed System.Net.WebSockets.Client code with a few tweaks to work on .NET 4.5.

The code was taken from the CoreFX release/2.0.0 branch on Nov 28th, 2017:


Most the tweaks required are in the added files NET45Shims.cs and SR.cs, with a few changes to the original source when extensions methods could not be leveraged (NET46-only properties and statics).

The only actual NET 4.6+ features used were some Task helpers (Task.FromException, Task.FromCanceled, Task.CompletedTask) and the Socket.ConnectAsync task. Microsoft could easily fix these and provide an official nuget package like this to support Win7 and .NET 4.5.

Install

Nuget package as System.Net.WebSockets.Client.Managed

PM> Install-Package System.Net.WebSockets.Client.Managed

Usage

System.Net.WebSockets.SystemClientWebSocket class has some helpers for easily creating a ClientWebSocket that will work on the current system.

// Creates a ClientWebSocket that works for this platform. Uses System.Net.WebSockets.ClientWebSocket if supported or System.Net.WebSockets.Managed.ClientWebSocket if not.
public static WebSocket SystemClientWebSocket.CreateClientWebSocket() { ... }

// Creates and connects a ClientWebSocket that works for this platform. Uses System.Net.WebSockets.ClientWebSocket if supported or System.Net.WebSockets.Managed.ClientWebSocket if not.
public static async Task<WebSocket> ConnectAsync(Uri uri, CancellationToken cancellationToken)

If you know you want a managed instance than use new System.Net.WebSockets.Managed.ClientWebSocket() rather than new System.Net.WebSockets.ClientWebSocket()

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].