Websockets.Standard 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Websockets.Standard --version 1.0.0                
NuGet\Install-Package Websockets.Standard -Version 1.0.0                
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="Websockets.Standard" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Websockets.Standard --version 1.0.0                
#r "nuget: Websockets.Standard, 1.0.0"                
#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 Websockets.Standard as a Cake Addin
#addin nuget:?package=Websockets.Standard&version=1.0.0

// Install Websockets.Standard as a Cake Tool
#tool nuget:?package=Websockets.Standard&version=1.0.0                

Websockets.Standard

Websockets.Standard is a .Net Standard class library that wraps around different WebSocket implementations.

This project originated from WebSocket.PCL

Feel free to make an issue/pull request to support more library's/platforms

Platforms

  • Android (Native coming soon)
  • IOS (SocketRocket coming soon)
  • UWP
  • .NET Core
  • .NET Framework (4.5 and up)
  • .NET Standard (1.3 - 1.6)
  • .NET Standard2 (2.0 and up)
  • WP8 (dropped because silverlight is not .net standard/VS 2017 compatible)

NuGet

https://www.nuget.org/packages/Websockets.Standard/

Setup

Android

  • Include Websockets.Websocket4Net and Websockets.Standard library

Ios

  • Include Websockets.Websocket4Net and Websockets.Standard library

.Net Framework

  • Include Websockets.Net (or Websockets.NetStandard) and Websockets.Standard library

.Net Standard/Core

  • Include Websockets.NetStandard (or Websockets.NetStandard2) and Websockets.Standard library

Windows 10 Universal

  • Include Websockets.Universal and Websockets.Standard library

Xamarin Forms

  • Include the Websockets.Standard library in the main common app
  • Include the platform specific library in the platform projects

Windows 8 Phone

  • Fork or download source
  • Change Websocket4Net version to add silverlight support and compile with VS 2015
  • Include Websockets.Websocket4Net and Websockets.Standard library

Usage

        void Configure()
        {
            // Call in your specific platform startup            
            // 1) Link at startup before socket creation
            Websockets.Net.WebsocketConnection.Link();
        }
        
        
        void Connect()
        {
            // 2) Get a websocket from the standard library via the factory
            connection = Websockets.WebSocketFactory.Create();
            connection.OnOpened += Connection_OnOpened;
            connection.OnMessage += Connection_OnMessage;
        }

        void Send()
        {            
            connection.Open("http://echo.websocket.org");
            connection.Send("Hello World");
        }

        private void Connection_OnOpened()
        {
            Debug.WriteLine("Opened !");
        }

        private void Connection_OnMessage(string obj)
        {
            Echo = obj == "Hello World";
        }

Example

There are a few 'test' examples (projects with the Tests suffix). Take a look there. The relivent code is in a standalone test file. (some might not work yet!)

TODO

  • Make the actual NuGet Packages
  • Support .NET 2.0 and other old frameworks
  • Support Native Android (port from old project)
  • Support Ios SocketRocket (port from old project)
  • Support other platforms.

Questions

Make an issue and i will try to help asap.

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 netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.3 is compatible.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 was computed.  netstandard2.1 was computed. 
.NET Framework net46 was computed.  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 tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 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 (2)

Showing the top 2 NuGet packages that depend on Websockets.Standard:

Package Downloads
Websockets.WebSocket4Net

WebSocket4Net implementation of Websockets.Standard.

Websockets.Net

.NET framework implementation of Websockets.Standard, wraps default implementation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 960 1/18/2018
1.0.0 1,851 1/17/2018

Initial port to .NET Standard with a few fixes and changes.