Skip to content

Hmp1BuilderExtensions

Namespace: Hex1b

Assembly: Hex1b.dll

Extension methods for that wire up the HMP v1 (Hex1b Muxer Protocol v1) server and client adapters.

csharp
public static class Hmp1BuilderExtensions

Inheritance

ObjectHmp1BuilderExtensions

Methods

WithHmp1Client(Hex1bTerminalBuilder, Func<CancellationToken, Task<Stream>>, Action<Hmp1ClientOptions>?)

Configures the terminal as an HMP v1 client connecting through the given stream factory, with an configure callback for handshake hints and event hooks. The transport is pre-populated and cannot be replaced from the callback.

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1Client(this Hex1bTerminalBuilder builder, Func<CancellationToken, Task<Stream>> streamFactory, Action<Hmp1ClientOptions>? configure)

WithHmp1Client(Hex1bTerminalBuilder, Func<CancellationToken, Task<Stream>>)

Configures the terminal as an HMP v1 client connecting through the given stream factory.

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1Client(this Hex1bTerminalBuilder builder, Func<CancellationToken, Task<Stream>> streamFactory)

WithHmp1Client(Hex1bTerminalBuilder, Hmp1ClientOptions)

Configures the terminal as an HMP v1 client built from a fully populated options bag. Canonical overload — every other WithHmp1Client / WithHmp1Stream / WithHmp1UdsClient variant in this class delegates here.

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1Client(this Hex1bTerminalBuilder builder, Hmp1ClientOptions options)

WithHmp1Server(Hex1bTerminalBuilder, Func<CancellationToken, IAsyncEnumerable<Stream>>, Action<Hmp1ServerOptions>?)

Adds an HMP v1 server listener that accepts client connections from the given async stream source, with an configuration callback for stream transforms and lifecycle event hooks.

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1Server(this Hex1bTerminalBuilder builder, Func<CancellationToken, IAsyncEnumerable<Stream>> streamSource, Action<Hmp1ServerOptions>? configure)

WithHmp1Server(Hex1bTerminalBuilder, Func<CancellationToken, IAsyncEnumerable<Stream>>)

Adds an HMP v1 server listener that accepts client connections from the given async stream source. Can be called multiple times to serve over multiple transports simultaneously.

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1Server(this Hex1bTerminalBuilder builder, Func<CancellationToken, IAsyncEnumerable<Stream>> streamSource)

WithHmp1Stream(Hex1bTerminalBuilder, Stream, Action<Hmp1ClientOptions>?)

Configures the terminal as an HMP v1 client over an already-connected bidirectional stream, with an configure callback for handshake hints and event hooks.

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1Stream(this Hex1bTerminalBuilder builder, Stream stream, Action<Hmp1ClientOptions>? configure)

WithHmp1Stream(Hex1bTerminalBuilder, Stream)

Configures the terminal as an HMP v1 client over an already-connected bidirectional stream (e.g. an in-memory pipe pair, a WebSocket-backed stream, or a test fixture).

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1Stream(this Hex1bTerminalBuilder builder, Stream stream)

WithHmp1UdsClient(Hex1bTerminalBuilder, string, Action<Hmp1ClientOptions>?)

Configures the terminal as an HMP v1 client connecting to a Unix domain socket, with an configure callback for handshake hints, an optional stream transform (e.g. TLS), and event hooks.

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1UdsClient(this Hex1bTerminalBuilder builder, string socketPath, Action<Hmp1ClientOptions>? configure)

WithHmp1UdsClient(Hex1bTerminalBuilder, string)

Configures the terminal as an HMP v1 client connecting to a Unix domain socket.

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1UdsClient(this Hex1bTerminalBuilder builder, string socketPath)

WithHmp1UdsServer(Hex1bTerminalBuilder, string, Action<Hmp1ServerOptions>?)

Adds an HMP v1 server listener on a Unix domain socket, with an configuration callback for stream transforms (e.g. TLS) and lifecycle event hooks.

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1UdsServer(this Hex1bTerminalBuilder builder, string socketPath, Action<Hmp1ServerOptions>? configure)

WithHmp1UdsServer(Hex1bTerminalBuilder, string)

Adds an HMP v1 server listener on a Unix domain socket. Can be called multiple times to serve over multiple sockets.

Parameters:

Returns: Hex1bTerminalBuilder

csharp
public static Hex1bTerminalBuilder WithHmp1UdsServer(this Hex1bTerminalBuilder builder, string socketPath)

Remarks

This is the recommended ("easy path") surface for building HMP v1 producers and consumers. The extensions construct the underlying / internally and deliver an via , so user code never has to traffic in adapter types.

Advanced consumers that need to drive before assembling the surrounding terminal (typically because the builder needs producer dimensions before Build()) construct the adapter directly and pass it to WithWorkload; that path stays available but is deliberately outside this extension family.

Released under the MIT License.