diff --git a/Yamux.sln b/Yamux.sln deleted file mode 100644 index 62ca858..0000000 --- a/Yamux.sln +++ /dev/null @@ -1,87 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 18 -VisualStudioVersion = 18.8.12021.73 stable -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{35C4EF98-C91B-486C-AFBD-81BEA43EC2E5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "samples\Sample\Sample.csproj", "{82FE32DE-30B6-416A-B069-80F07D16077A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileTransfer", "samples\FileTransfer\FileTransfer.csproj", "{85D22ECE-3DAD-4D0B-8130-C7193B2372B0}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yamux.Tests", "test\Yamux.Tests\Yamux.Tests.csproj", "{EDB8F4EB-4D96-7A5B-F374-FB7467EB4919}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}" - ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - README.md = README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{79365D20-9CC6-4DBB-A747-3965F5D77ABE}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{3056ACE1-BAB5-4DF5-B67D-5E2EF5A7F61F}" - ProjectSection(SolutionItems) = preProject - .github\workflows\lunet-gh-pages.yml = .github\workflows\lunet-gh-pages.yml - .github\workflows\nuget-publish.yml = .github\workflows\nuget-publish.yml - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yamux", "src\Yamux.csproj", "{077347A1-66A3-1807-CB3C-F247195DFE47}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{15A0A680-B554-4726-BB82-8D5090925BDF}" - ProjectSection(SolutionItems) = preProject - docs\Channels.md = docs\Channels.md - docs\Exceptions.md = docs\Exceptions.md - docs\README.md = docs\README.md - docs\Session.md = docs\Session.md - docs\SessionChannelOptions.md = docs\SessionChannelOptions.md - docs\SessionOptions.md = docs\SessionOptions.md - docs\Statistics.md = docs\Statistics.md - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yamux.Benchmark", "benchmarks\Yamux.Benchmark\Yamux.Benchmark.csproj", "{30DFE48D-D223-167A-2BCC-96DE8F38EB6C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{C470F19F-8DCC-411A-A86A-2750685A0101}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {82FE32DE-30B6-416A-B069-80F07D16077A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {82FE32DE-30B6-416A-B069-80F07D16077A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {82FE32DE-30B6-416A-B069-80F07D16077A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {82FE32DE-30B6-416A-B069-80F07D16077A}.Release|Any CPU.Build.0 = Release|Any CPU - {85D22ECE-3DAD-4D0B-8130-C7193B2372B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85D22ECE-3DAD-4D0B-8130-C7193B2372B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85D22ECE-3DAD-4D0B-8130-C7193B2372B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85D22ECE-3DAD-4D0B-8130-C7193B2372B0}.Release|Any CPU.Build.0 = Release|Any CPU - {EDB8F4EB-4D96-7A5B-F374-FB7467EB4919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EDB8F4EB-4D96-7A5B-F374-FB7467EB4919}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EDB8F4EB-4D96-7A5B-F374-FB7467EB4919}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EDB8F4EB-4D96-7A5B-F374-FB7467EB4919}.Release|Any CPU.Build.0 = Release|Any CPU - {077347A1-66A3-1807-CB3C-F247195DFE47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {077347A1-66A3-1807-CB3C-F247195DFE47}.Debug|Any CPU.Build.0 = Debug|Any CPU - {077347A1-66A3-1807-CB3C-F247195DFE47}.Release|Any CPU.ActiveCfg = Release|Any CPU - {077347A1-66A3-1807-CB3C-F247195DFE47}.Release|Any CPU.Build.0 = Release|Any CPU - {30DFE48D-D223-167A-2BCC-96DE8F38EB6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {30DFE48D-D223-167A-2BCC-96DE8F38EB6C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {30DFE48D-D223-167A-2BCC-96DE8F38EB6C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {30DFE48D-D223-167A-2BCC-96DE8F38EB6C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {82FE32DE-30B6-416A-B069-80F07D16077A} = {35C4EF98-C91B-486C-AFBD-81BEA43EC2E5} - {85D22ECE-3DAD-4D0B-8130-C7193B2372B0} = {35C4EF98-C91B-486C-AFBD-81BEA43EC2E5} - {EDB8F4EB-4D96-7A5B-F374-FB7467EB4919} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} - {3056ACE1-BAB5-4DF5-B67D-5E2EF5A7F61F} = {79365D20-9CC6-4DBB-A747-3965F5D77ABE} - {30DFE48D-D223-167A-2BCC-96DE8F38EB6C} = {C470F19F-8DCC-411A-A86A-2750685A0101} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A47742C3-5963-489F-A1A2-D2A4F269BFE7} - EndGlobalSection -EndGlobal diff --git a/Yamux.slnx b/Yamux.slnx new file mode 100644 index 0000000..3f5be1a --- /dev/null +++ b/Yamux.slnx @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/config.scriban b/docs/config.scriban index 3c9a8d7..6523d69 100644 --- a/docs/config.scriban +++ b/docs/config.scriban @@ -1,6 +1,7 @@ extend "lunet-io/templates" template_theme_default_mode = "dark" +template_theme_override_styles = ["/css/theme-override.scss"] site_project_baseurl = "https://pableess.github.io" site_project_basepath = "/yamux-dotnet" @@ -9,8 +10,14 @@ site_project_description = "A .NET implementation of the HashiCorp Yamux multipl site_project_github_user = "pableess" site_project_github_repo = "yamux-dotnet" site_project_owner_name = "Paul Bleess" +site_project_owner_alias = "pableess" +site_project_owner_url = "https://github.com/pableess" site_project_license_name = "MIT" site_project_content_license_name = "MIT" +site_project_content_license_url = "https://opensource.org/licenses/MIT" + +# Logo configuration +site_project_logo_path = "/img/yamux.png" # Use index.md (not readme.md) as the home page readme_as_index = false diff --git a/docs/css/theme-override.scss b/docs/css/theme-override.scss new file mode 100644 index 0000000..6ad65ed --- /dev/null +++ b/docs/css/theme-override.scss @@ -0,0 +1,27 @@ +/* Round corners and transparent background for images */ +img { + border-radius: 8px; + background: transparent !important; +} + +/* Lighten card backgrounds */ +.card, +.card-header, +.card-body { + background: transparent !important; +} + +.card { + background-color: color-mix(in srgb, var(--lunet-color-surface-1) 50%, transparent) !important; + backdrop-filter: blur(4px); +} + +/* Lighten the hero image area */ +.text-center img { + border-radius: 12px; +} + +/* Lighten code blocks */ +pre { + background-color: color-mix(in srgb, var(--lunet-color-code-bg, var(--lunet-color-surface-1)) 50%, transparent) !important; +} \ No newline at end of file diff --git a/docs/Channels.md b/docs/docs/Channels.md similarity index 100% rename from docs/Channels.md rename to docs/docs/Channels.md diff --git a/docs/Exceptions.md b/docs/docs/Exceptions.md similarity index 100% rename from docs/Exceptions.md rename to docs/docs/Exceptions.md diff --git a/docs/Performance.md b/docs/docs/Performance.md similarity index 100% rename from docs/Performance.md rename to docs/docs/Performance.md diff --git a/docs/Session.md b/docs/docs/Session.md similarity index 100% rename from docs/Session.md rename to docs/docs/Session.md diff --git a/docs/SessionChannelOptions.md b/docs/docs/SessionChannelOptions.md similarity index 100% rename from docs/SessionChannelOptions.md rename to docs/docs/SessionChannelOptions.md diff --git a/docs/SessionOptions.md b/docs/docs/SessionOptions.md similarity index 100% rename from docs/SessionOptions.md rename to docs/docs/SessionOptions.md diff --git a/docs/Statistics.md b/docs/docs/Statistics.md similarity index 100% rename from docs/Statistics.md rename to docs/docs/Statistics.md diff --git a/docs/Transport.md b/docs/docs/Transport.md similarity index 100% rename from docs/Transport.md rename to docs/docs/Transport.md diff --git a/docs/getting-started.md b/docs/docs/getting-started.md similarity index 100% rename from docs/getting-started.md rename to docs/docs/getting-started.md diff --git a/docs/docs/menu.yml b/docs/docs/menu.yml new file mode 100644 index 0000000..216e6a0 --- /dev/null +++ b/docs/docs/menu.yml @@ -0,0 +1,10 @@ +doc: + - {path: getting-started.md, title: "Getting Started"} + - {path: Session.md, title: "Session"} + - {path: Channels.md, title: "Channels"} + - {path: SessionOptions.md, title: "SessionOptions"} + - {path: SessionChannelOptions.md, title: "SessionChannelOptions"} + - {path: Statistics.md, title: "Statistics"} + - {path: Transport.md, title: "Transport"} + - {path: Exceptions.md, title: "Exceptions"} + - {path: Performance.md, title: "Performance"} \ No newline at end of file diff --git a/docs/img/yamux-dotnet.png b/docs/img/yamux-dotnet.png new file mode 100644 index 0000000..052aa41 Binary files /dev/null and b/docs/img/yamux-dotnet.png differ diff --git a/docs/img/yamux.png b/docs/img/yamux.png new file mode 100644 index 0000000..e965cd3 Binary files /dev/null and b/docs/img/yamux.png differ diff --git a/docs/index.md b/docs/index.md index b39010f..b1eae44 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,138 +1,94 @@ --- title: Home +layout: simple +og_type: website --- -# Yamux .NET Library - -A high-performance .NET implementation of the [HashiCorp Yamux multiplexing protocol](https://github.com/hashicorp/yamux). Yamux enables multiple reliable, ordered, independent streams (channels) over a **single** underlying connection. - -```bash -dotnet add package Yamux -``` - -
- -
-
-
-
Getting Started
-

Setup guide for server and client using Yamux sessions and channels.

- -
-
-
- -
-
-
-
Session
-

Session lifecycle, channel management, ping, and graceful shutdown.

- -
-
-
- -
-
-
-
Channels
-

Using IDuplexSessionChannel, IReadOnlySessionChannel, and IWriteOnlySessionChannel.

- -
-
-
- -
-
-
-
SessionOptions
-

Configuration for keep-alive, max channels, statistics, and metrics.

- -
-
-
- -
-
-
-
SessionChannelOptions
-

Flow control, receive window sizing, and auto-tuning configuration.

- -
-
-
- -
-
-
-
Statistics
-

Per-session and per-channel bandwidth tracking with sampled events.

- -
-
-
- -
-
-
-
Transport
-

Pluggable transports: Stream, Socket, IDuplexPipe, or custom ITransport.

- -
-
-
- -
-
-
-
Exceptions
-

SessionException, SessionChannelException, and protocol error handling.

- -
-
-
- -
-
-
-
Performance
-

Benchmarks comparing Yamux .NET vs Go Yamux and Nerdbank.Streams.

- -
-
-
- -
- -## Features - -- **Full-duplex multiplexing** — hundreds of logical streams over a single connection -- **Channel-based abstraction** — `IDuplexSessionChannel`, `IReadOnlySessionChannel`, `IWriteOnlySessionChannel` -- **Configurable flow control** — automatic window tuning based on RTT -- **Keep-alive and RTT** — dead connection detection and round-trip measurement -- **Bandwidth statistics** — per-session and per-channel tracking with `Sampled` events -- **OpenTelemetry metrics** — `System.Diagnostics.Metrics` integration -- **High performance** — built on `System.IO.Pipelines`, pooled value task sources, lock-free ID generation -- **AOT compatible** — supports Native AOT publish -- **Graceful shutdown** — channel drain with configurable timeouts -- **Pluggable transports** — `Stream`, `Socket`, `IDuplexPipe`, or custom `ITransport` - -## Quick Example - -```csharp -// Server -await using var session = socket.AsYamuxSession(isClient: false); -session.Start(); -var channel = await session.AcceptAsync(); - -// Client -await using var session = socket.AsYamuxSession(isClient: true); -session.Start(); -var channel = await session.OpenChannelAsync(); -``` - -## Installation - -```bash -dotnet add package Yamux -``` +
+
+ Yamux .NET - Multiplexing for .NET +

+ A high-performance .NET implementation of the HashiCorp Yamux multiplexing protocol.
+ Multiple reliable, ordered, independent streams over a single underlying connection. +

+ +
+
dotnet add package Yamux
+
+
+
+ +
+
+
+
+
Full-duplex multiplexing
+
+

+ Hundreds of logical streams over a single connection. Built on System.IO.Pipelines for high-performance I/O. +

+ Session docs +
+
+
+
+
+
Channel-based abstraction
+
+

+ IDuplexSessionChannel, IReadOnlySessionChannel, and IWriteOnlySessionChannel for flexible stream management. +

+ Channel docs +
+
+
+
+
+
Configurable flow control
+
+

+ Automatic window tuning based on RTT. Configurable receive window sizes and upper bounds. +

+ Options docs +
+
+
+
+
+
Bandwidth statistics
+
+

+ Per-session and per-channel bandwidth tracking with Sampled events and OpenTelemetry metrics integration. +

+ Statistics docs +
+
+
+
+
+
Pluggable transports
+
+

+ Support for Stream, Socket, IDuplexPipe, or custom ITransport implementations. +

+ Transport docs +
+
+
+
+
+
High performance
+
+

+ Pooled value task sources, lock-free ID generation, AOT compatible, and native publish support. +

+ Benchmarks +
+
+
+
+
\ No newline at end of file diff --git a/docs/menu.yml b/docs/menu.yml index 2394fc4..373774b 100644 --- a/docs/menu.yml +++ b/docs/menu.yml @@ -1,18 +1,7 @@ home: - {path: index.md, title: "Home", self: true} - - {path: getting-started.md, title: "Getting Started"} + - {path: docs/Session.md, title: "Docs", folder: true} home2: - - {url: "https://github.com/pableess/yamux-dotnet", title: "GitHub", link_class: "btn btn-info"} - - {url: "https://www.nuget.org/packages/Yamux", title: "NuGet", link_class: "btn btn-info"} - -doc: - - {path: getting-started.md, title: "Getting Started"} - - {path: Session.md, title: "Session"} - - {path: Channels.md, title: "Channels"} - - {path: SessionOptions.md, title: "SessionOptions"} - - {path: SessionChannelOptions.md, title: "SessionChannelOptions"} - - {path: Statistics.md, title: "Statistics"} - - {path: Transport.md, title: "Transport"} - - {path: Exceptions.md, title: "Exceptions"} - - {path: Performance.md, title: "Performance"} + - {url: "https://github.com/pableess/yamux-dotnet", title: "GitHub", link_class: "btn btn-primary"} + - {url: "https://www.nuget.org/packages/Yamux", title: "NuGet", link_class: "btn btn-primary"}