ShaRPC.Transports.NamedPipes 1.0.0-ci.30

This is a prerelease version of ShaRPC.Transports.NamedPipes.
dotnet add package ShaRPC.Transports.NamedPipes --version 1.0.0-ci.30
                    
NuGet\Install-Package ShaRPC.Transports.NamedPipes -Version 1.0.0-ci.30
                    
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="ShaRPC.Transports.NamedPipes" Version="1.0.0-ci.30" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ShaRPC.Transports.NamedPipes" Version="1.0.0-ci.30" />
                    
Directory.Packages.props
<PackageReference Include="ShaRPC.Transports.NamedPipes" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ShaRPC.Transports.NamedPipes --version 1.0.0-ci.30
                    
#r "nuget: ShaRPC.Transports.NamedPipes, 1.0.0-ci.30"
                    
#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.
#:package ShaRPC.Transports.NamedPipes@1.0.0-ci.30
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ShaRPC.Transports.NamedPipes&version=1.0.0-ci.30&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ShaRPC.Transports.NamedPipes&version=1.0.0-ci.30&prerelease
                    
Install as a Cake Tool

Named Pipe Transport

ShaRPC.Transports.NamedPipes provides first-class named-pipe client and server transports for local process-boundary IPC. It is a separate package so hosts that only need TCP or custom transports do not take a named-pipe dependency.

Install

dotnet add package ShaRPC.Transports.NamedPipes

The package depends on ShaRPC and reuses StreamConnection for framing. That means named-pipe traffic uses the same length validation, serialized sends, pooled receive buffers, and clean EOF behavior as every other stream-backed ShaRPC connection.

Host And Caller

A RpcHost turns every accepted named-pipe connection into an RpcPeer; a caller wraps a connected pipe in its own RpcPeer. The generated Provide.../Get... extension methods replace the old builder AddX/CreateXProxy calls.

using ShaRPC.Core;
using ShaRPC.Generated;
using ShaRPC.Serializers.MessagePack;
using ShaRPC.Transports.NamedPipes;

var pipeName = "my-plugin-host";

await using var host = RpcHost
    .Listen(new NamedPipeServerTransport(pipeName), new MessagePackRpcSerializer())
    .ForEachPeer(peer => peer.ProvidePluginHost(new PluginHost()));
await host.StartAsync();

await using var clientTransport = new NamedPipeClientTransport(pipeName);
await clientTransport.ConnectAsync();
await using var peer = RpcPeer
    .Over(clientTransport.Connection!, new MessagePackRpcSerializer(),
          new RpcPeerOptions { RequestTimeout = TimeSpan.FromSeconds(5), RejectInboundCalls = true })
    .Start();

var pluginHost = peer.GetPluginHost();
await pluginHost.PingAsync();

RejectInboundCalls = true signals a get-only intent — the caller does not provide any service of its own. Drop it (and add Provide... calls) when the caller also needs to be called back over the same pipe. The host can react to lifecycle events via host.PeerConnected, host.PeerDisconnected, and host.AcceptError; stop it with await host.StopAsync() (disposal also stops it).

Use the (serverName, pipeName) client constructor when connecting to a remote Windows machine:

var transport = new NamedPipeClientTransport("build-agent-01", "my-plugin-host");

Duplex Peers

Named-pipe streams are duplex, so a single RpcPeer over one pipe connection can both serve and call services when both processes need to talk over the same authenticated pipe. The transports already hand back an IRpcChannel (clientTransport.Connection! / serverConnection from AcceptAsync); wrap a raw PipeStream in StreamConnection only when you manage the stream yourself. Each side calls Provide... for what it serves and Get... for what it calls:

using ShaRPC.Core;
using ShaRPC.Core.Transport;
using ShaRPC.Generated;
using ShaRPC.Serializers.MessagePack;

Stream pipeStream = /* connected PipeStream */;
await using IRpcChannel connection = new StreamConnection(pipeStream, "pipe://plugin-host");

await using var peer = RpcPeer
    .Over(connection, new MessagePackRpcSerializer(),
          new RpcPeerOptions
          {
              RequestTimeout = TimeSpan.FromSeconds(5),
              InboundQueueCapacity = 256,
              QueueFullMode = ShaRpcQueueFullMode.Wait,
          })
    .ProvidePluginHost(new PluginHost())
    .Start();

var plugin = peer.GetPluginCallbacks();

For full symmetry both processes do the same thing — each wraps its end of the pipe in an RpcPeer, provides its own service, and gets a proxy to the other side over the one connection. Set InboundQueueCapacity (or null for unbounded) and QueueFullMode to bound how queued inbound requests are handled under pressure, and raise MaxConcurrentInboundDispatch above the default 1 for bounded-concurrent dispatch instead of strict serial-per-connection handling.

RpcPeer.Disconnected reports the endpoint and the closing exception, and RpcPeer.ReadError surfaces read-loop failures with endpoint and error details. On a host, subscribe per peer inside ForEachPeer (for example peer.ReadError += ...) or watch host.PeerDisconnected for the aggregate signal.

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.
  • .NETStandard 2.1

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-ci.30 385 6/12/2026
1.0.0-ci.20 119 6/11/2026
1.0.0-ci.19 70 6/11/2026
1.0.0-ci.18 72 6/8/2026
1.0.0-ci.17 73 6/7/2026
1.0.0-ci.15 72 6/7/2026
1.0.0-ci.14 86 6/7/2026
1.0.0-ci.13 74 6/5/2026
1.0.0-ci.11 70 6/3/2026