{"id":18822928,"url":"https://github.com/adaptiveconsulting/aeron.net","last_synced_at":"2025-05-14T06:12:07.182Z","repository":{"id":44574467,"uuid":"58124772","full_name":"AdaptiveConsulting/Aeron.NET","owner":"AdaptiveConsulting","description":"Efficient reliable UDP unicast, UDP multicast, and IPC message transport - .NET port of Aeron","archived":false,"fork":false,"pushed_at":"2025-03-14T10:53:14.000Z","size":59909,"stargazers_count":496,"open_issues_count":1,"forks_count":93,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-05-13T01:44:26.308Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdaptiveConsulting.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-05T10:59:26.000Z","updated_at":"2025-04-24T11:35:15.000Z","dependencies_parsed_at":"2024-01-05T20:52:00.976Z","dependency_job_id":"e4af0722-8f41-4dd7-9c23-f7385a879532","html_url":"https://github.com/AdaptiveConsulting/Aeron.NET","commit_stats":{"total_commits":365,"total_committers":23,"mean_commits":"15.869565217391305","dds":"0.23561643835616441","last_synced_commit":"6a7abfbc8d15000a8b3e24bc4cb0d91c1e20f09a"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaptiveConsulting%2FAeron.NET","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaptiveConsulting%2FAeron.NET/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaptiveConsulting%2FAeron.NET/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdaptiveConsulting%2FAeron.NET/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdaptiveConsulting","download_url":"https://codeload.github.com/AdaptiveConsulting/Aeron.NET/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254083590,"owners_count":22011901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T00:52:08.472Z","updated_at":"2025-05-14T06:12:07.161Z","avatar_url":"https://github.com/AdaptiveConsulting.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aeron.NET\n[![GitHub Actions](https://github.com/AdaptiveConsulting/Aeron.NET/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/AdaptiveConsulting/Aeron.NET/actions/workflows/ci.yml)\n[![NuGet](https://img.shields.io/nuget/v/Aeron.Client.svg)](https://www.nuget.org/packages/Aeron.Client/)\n\nA .NET port of the [Aeron Client](https://github.com/aeron-io/aeron).\n\nAeron is an efficient reliable UDP unicast, UDP multicast, and IPC message transport.\n\nPerformance is the key focus. Aeron is designed to have the highest throughput with the lowest and most predictable latency possible of any messaging system. \nAeron is designed not to perform any allocations after the initial set-up, this means less time will be spent garbage collecting and as a result, latency will be kept down.\n\n### Getting Started\nAeron comes in two parts: the media driver and the client.\n\n![Architecture Overview](images/Overview.png?raw=true \"Overview\")\n\n#### Media Driver\nThe driver runs in its own process and communicates with the client directly via shared memory. It sends and receives messages across the network to other drivers or routes messages to other clients on the same host.\n\nTo run the media driver, you will need [Java 8 JRE](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html) installed. \n\nThere is a nuget package that contains the driver:\n\n    PM\u003e Install-Package Aeron.Driver\n\nIt will create a directory in your project with a bat file to launch the driver.\n\nOr if you've got the source, run:\n\n    driver/start-media-driver.bat\n\n#### Client  \nThe client can be [built from source](#building-from-source) or installed from nuget:\nhttps://www.nuget.org/packages/Aeron.Client/\n\n    PM\u003e Install-Package Aeron.Client\n\n### Usage\nThe full example is [here](src/Samples/Adaptive.Aeron.Samples.HelloWorld/HelloWorld.cs).\n\n#### Publisher\nUsed to send messages to a specified channel \u0026 stream.\n```csharp\nconst string channel = \"aeron:ipc\";\nconst int streamId = 42;\n\nUnsafeBuffer buffer = new UnsafeBuffer(new byte[256]);\n\nusing(Aeron aeron = Aeron.Connect())\nusing(Publication publisher = aeron.AddPublication(channel, streamId)) {\n  int messageLength = buffer.PutStringWithoutLengthUtf8(0, \"Hello World!\");\n  publisher.Offer(buffer, 0, messageLength);\n}\n```\n#### Fragment Handler\nA fragment handler is a delegate used for processing data that is has been received. The buffer will either contain a whole message or a fragment of a message to be reassembled.\n```csharp\nstatic void PrintMessage(IDirectBuffer buffer, int offset, int length, Header header)\n{\n  var message = buffer.GetStringWithoutLengthUtf8(offset, length);\n  Console.WriteLine($\"Message Received: '{message}'\");\n}\n```\n\n#### Subscriber\nA subscriber is used to register interest in messages from a publisher on a specific channel \u0026 stream. It uses a fragment handler to process the received messages.\n```csharp\nusing(Subscription subscriber = aeron.AddSubscription(channel, streamId)) {\n  while(subscriber.Poll(PrintMessage, 1) == 0) {  \n      Thread.Sleep(10);\n  }\n}\n```\n\n### Samples\nHere are some of the samples that come with Aeron.\nBefore running the samples, they need to be built (you will need [Visual Studio 2017](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx) installed). Run:\n\n    scripts/build.bat\n\n#### Hello World\nThis samples sends and receives a hello world message. Make sure the [media driver](#media-driver) is running and run the following batch script:\n\n    scripts/hello-world.bat\n    \nYou should see something like:\n\n```\nReceived message (Hello World!) to stream 42 from session 42d2f651 term id de97c9e0 term offset 0 (11@32)\nPress any key to continue...\n```\n\nThe source code is [here](src/Samples/Adaptive.Aeron.Samples.HelloWorld/HelloWorld.cs).\n\n#### Throughput\nThis sample shows the overall throughput of the client and driver. It sends messages via `aeron:ipc` which is designed for interprocess communication. Make sure the [media driver](#media-driver) is running and run the sample:\n\n    scripts/throughput.bat\n\nIt runs 2 threads which publish and subscribe 32-byte messages and every second prints out the number of messages \u0026 total number of bytes that were sent/received.\n        \n```\nDuration 1,001ms - 14,047,600 messages - 449,523,200 bytes\nDuration 1,000ms - 14,031,801 messages - 449,017,632 bytes\nDuration 1,001ms - 15,054,055 messages - 481,729,760 bytes\nDuration 1,000ms - 14,678,982 messages - 469,727,424 bytes\n```\n\nThe source code is [here](src/Samples/Adaptive.Aeron.Samples.IpcThroughput/IpcThroughput.cs).\n    \n#### Ping/Pong\nThis sample show the latencies for a batch of messages.  Make sure the [media driver](#media-driver) is running and start `pong` which listens for messages and will reply back to each message:\n\n    scripts/pong.bat\n    \nThen start `ping` which send messages with the current time to `pong` and then records the latency when it receives a response to that message.\n\n    scripts/ping.bat\n    \nAfter 1,000,000 messages have been sent, you'll be presented with a histogram.\n\n```\nHistogram of RTT latencies in microseconds.\n       Value     Percentile TotalCount 1/(1-Percentile)\n\n       9.391 0.000000000000          1           1.00\n      11.383 0.100000000000      11404           1.11\n      11.663 0.200000000000      25421           1.25\n      11.951 0.300000000000      43399           1.43\n      11.951 0.400000000000      43399           1.67\n      15.647 0.500000000000      52070           2.00\n      15.935 0.550000000000      57140           2.22\n      16.215 0.600000000000      64190           2.50\n      16.511 0.650000000000      68864           2.86\n      17.071 0.700000000000      71236           3.33\n      17.647 0.750000000000      82369           4.00\n      17.647 0.775000000000      82369           4.44\n      17.647 0.800000000000      82369           5.00\n      17.935 0.825000000000      90885           5.71\n...\n    5013.503 0.999989318848      99999       93622.86\n    5021.695 0.999990844727     100000      109226.67\n    5021.695 1.000000000000     100000\n#[Mean    =       15.195, StdDeviation   =       46.974]\n#[Max     =     5021.695, Total count    =       100000]\n#[Buckets =           24, SubBuckets     =         2048]\n```\n\nWhich you can upload to http://hdrhistogram.github.io/HdrHistogram/plotFiles.html to create a nice chart:\n\n![Latency Histogram](images/Histogram.png?raw=true \"Latency Histogram\")\n\nThe source code is [here](src/Samples/Adaptive.Aeron.Samples.Ping/Ping.cs) and [here](src/Samples/Adaptive.Aeron.Samples.Pong/Pong.cs).\n\n### Building from Source\nYou will need [Visual Studio 2017 Update 3](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx) installed. \nAlso, as the tooling hasn't caught up yet you'll need the last [.NET Core SDK](https://www.microsoft.com/net/download/core)\n\n1. Open `src/Adaptive.Aeron.sln`. \n2. Click `Build -\u003e Build Solution`.\n\nNote: For best performance, build in x64 release mode and run without the debugger attached.\n\n### Running tests\nAs Aeron.NET now supports multitargeting, the only way to properly run tests for all framework versions is from dotnet cli issuing `dotnet test` on the test project folders, Visual Studio 2017 will only detect one project when launching the test runner\n\n### Packing NuGets\nRun `dotnet pack src\\Adaptive.Aeron\\Adaptive.Aeron.csproj /p:Configuration=Release`\n\nIf there are also changes in Agrona run `src\\Adaptive.Agrona\\Adaptive.Agrona.csproj /p:Configuration=Release` Aeron depends on it so both should be published at the same time\n\n### More Information\nThe best place for more information is the [Aeron Website](https://aeron.io)\n\n### Sponsors\nMany thanks to our **premium sponsors**!\n\n\u003cp align=\"left\"\u003e\n\u003ca href=\"https://www.tickmill.com/\" target=_blank\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/AdaptiveConsulting/Aeron.NET/master/.github/assets/sponsors/tickmill.png\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://www.rwe.com/\" target=_blank\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/AdaptiveConsulting/Aeron.NET/master/.github/assets/sponsors/rwe.png\"/\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptiveconsulting%2Faeron.net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadaptiveconsulting%2Faeron.net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptiveconsulting%2Faeron.net/lists"}