NamedPipeReplServer
A local, same-user listener. Each connection owns one backend instance.
- Kind:
Class - Namespace: Repl.Remote
- Assembly:
Repl.Remote - Source: src/Repl.Remote/NamedPipeReplServer.cs
Signature
Section titled “Signature”public sealed class NamedPipeReplServer : IAsyncDisposableInheritance
Section titled “Inheritance”Implements
Section titled “Implements”Constructors
Section titled “Constructors”NamedPipeReplServer(string, Func<CancellationToken, ValueTask<IRemoteReplBackend>>, Action<Exception>?)
Section titled “NamedPipeReplServer(string, Func<CancellationToken, ValueTask<IRemoteReplBackend>>, Action<Exception>?)”Starts accepting connections. An already-owned endpoint causes construction to fail.
public NamedPipeReplServer(string pipeName, Func<CancellationToken, ValueTask<IRemoteReplBackend>> backendFactory, Action<Exception>? onError = null)Parameters
Section titled “Parameters”pipeName(string): The local endpoint name.backendFactory(Func<CancellationToken, ValueTask<IRemoteReplBackend>>): Creates the backend that owns one connection.onError(Action<Exception>): Receives the detail of every failure the client sees only as a sanitized error or a dropped connection: a backend method or terminal failure, a connection that failed, a fault that stops the endpoint accepting, and a cleanup failure after DisposeAsync() timed out. It runs on the failing path, possibly for several connections at once, so it should only record the error and be thread-safe; an exception it throws is traced and otherwise ignored.
Methods
Section titled “Methods”ConnectAsync(string, CancellationToken)
Section titled “ConnectAsync(string, CancellationToken)”Connects locally with a caller-specified deadline. The returned client owns its pipe.
public static Task<RemoteReplClient> ConnectAsync(string pipeName, CancellationToken cancellationToken)Parameters
Section titled “Parameters”pipeName(string)cancellationToken(CancellationToken)
Returns
Section titled “Returns”Task<RemoteReplClient>
DisposeAsync()
Section titled “DisposeAsync()”Stops accepting and closes owned pipes, waiting up to five seconds for cancellation callbacks and in-flight sessions.
public ValueTask DisposeAsync()Returns
Section titled “Returns”Properties
Section titled “Properties”Completion
Section titled “Completion”Gets the accept loop; a fault means the endpoint is no longer being served. The fault is also reported to the error callback, but a host should observe this task to stop or restart in response.
public Task Completion { get; }