SharpChannels.Core 1.0.0-beta

.NET Standard 2.0
This is a prerelease version of SharpChannels.Core.
dotnet add package SharpChannels.Core --version 1.0.0-beta
NuGet\Install-Package SharpChannels.Core -Version 1.0.0-beta
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="SharpChannels.Core" Version="1.0.0-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SharpChannels.Core --version 1.0.0-beta
#r "nuget: SharpChannels.Core, 1.0.0-beta"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SharpChannels.Core as a Cake Addin
#addin nuget:?package=SharpChannels.Core&version=1.0.0-beta&prerelease

// Install SharpChannels.Core as a Cake Tool
#tool nuget:?package=SharpChannels.Core&version=1.0.0-beta&prerelease

SharpChannels is a simple and lightweight communication library for .NET.


Two things:

  1. Gives you the higher level entities to use for messaging instead of the byte streams and sockets.
    Namely: channels and messages
  2. Implements well-known messaging scenarios
  • request-response
  • publisher-subscriber
  • service bus


It is very expensive to develop a reliable server and client (using TCP for example), implement an application layer protocol for messaging, and then use all this stuff in a communication scenarios, like response to the requestor, broadcasts message to the subscribers etc.

SharpChannels has already done it all.

Use entities which can send and receive messages rather than write the byte sequence to or read it from stream. It also gives you a seamless switching between transport protocols.

  • TCP
  • In-process (inside AppDomain)
  • TLS 1.2
  • built-in for text messages
  • built-in for binary messages
  • native (using BinaryFormatter class)
  • proto-buf
  • custom user serialization
Other features
  • version based handshake
  • explicit channel closing (as in SCTP)


Нere is a simple example of request-response messaging using SharpChannels

Server side:

var serializer = new StringMessageSerializer();

var serverCommunication = new TcpCommunication<StringMessage>(
                            new TcpEndpointData(IPAddress.Any, 2000), 

var server = Scenarios.RequestResponse.SetupServer(serverCommunication)
    .UsingNewClientHandler((sender, a) => { Console.WriteLine("channel opened"); })
    .UsingRequestHandler((sender, a) => 
                        a.Response = new StringMessage(a.Request.Message.Replace("request", "response")); 
    .UsingChannelClosedHandler((sender, a) => { Console.WriteLine("channel closed"); })

Client side:

var clientCommunication = new TcpCommunication<StringMessage>(
                            new TcpEndpointData(IPAddress.Loopback, 2000), 

var r = Scenarios.RequestResponse.Requester(clientCommunication);

using (r.Channel)

    for (int i = 0; i < 100; i++)
        var requestMessage = new StringMessage($"request #{i}");

        var responseMessage = r.Request(requestMessage);

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SharpChannels.Core:

Package Downloads

Protobuf based serializer for SharpChannels

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-beta 756 1/18/2018