NetSharp

NetSharp.git
git clone git://git.lenczewski.org/NetSharp.git
Log | Files | Refs | README | LICENSE

commit ab046ff034d626e0a975ab22bdd335e249a8548a
parent 95065dd32dd38dbce75b79d55dc3572ac47964de
Author: Mikolaj Lenczewski <mikolaj.lenczewski308@gmail.com>
Date:   Fri,  1 Jan 2021 15:06:35 +0000

Updated README, removed useless Azure CI and GitHub Pages

Diffstat:
MREADME.md | 30+++---------------------------
AREADME.md.old | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D_config.yml | 2--
Dazure-pipelines.yml | 134-------------------------------------------------------------------------------
4 files changed, 79 insertions(+), 163 deletions(-)

diff --git a/README.md b/README.md @@ -10,34 +10,9 @@ For help with the library, feel free to visit our Discord and ask any questions | ------- | ------------ | | Discord | [![Discord Server][discord-server-badge]](https://discord.gg/DKQhxuY) | | Code Quality | [![CodeFactor](https://www.codefactor.io/repository/github/mblenczewski/netsharp/badge/master)](https://www.codefactor.io/repository/github/mblenczewski/netsharp/overview/master) | -| CI Build | [![Build Status](https://quartzstudios.visualstudio.com/NetSharp/_apis/build/status/mblenczewski.NetSharp?branchName=master)](https://quartzstudios.visualstudio.com/NetSharp/_build/latest?definitionId=7&branchName=master) | -The latest release build can be used by searching for NetSharp in the NuGet package manager. - -The latest unstable build, built from master at the time of the last commit, can be used either by adding the following XML snippet to your nuget.config (in the same folder as your .csproj or .sln) and restoring the package index: - -```xml -<?xml version="1.0" encoding="utf-8"?> -<configuration> - <packageSources> - <add key="NetSharpFeed" value="https://quartzstudios.pkgs.visualstudio.com/NetSharp/_packaging/NetSharpFeed/nuget/v3/index.json" /> - </packageSources> -</configuration> -``` - -Or by adding the following package source in Visual Studio, with the source name 'NetSharpFeed' and source url 'https://quartzstudios.pkgs.visualstudio.com/NetSharp/_packaging/NetSharpFeed/nuget/v3/index.json', under Tools > Options > NuGet Package Manager > Package Sources. - -## License - -This library is under the GNU General Public License v3.0. What does this mean for you? - -You can use this library for: 'Commercial Use', 'Private Use', and 'Patent Use'. You can make any modifications you want and you can distribute it as-is or with your modifications. - -When using this library in your project you must: 'Disclose the source' (a link to this GitHub is fine), 'Include a copy of the GNU GPL v3.0 with your project' (copy LICENSE to your projects root dir, named NetSharp-LICENSE), and 'State changes made' (documented somewhere accessible by users of your project). Should you modify this library in any way, the modified library must be released under the GNU GPL v3.0 license as well. Note that your own project doesn't have to be released under the GNU GPL v3.0, only your edited version of this library does. - -No warranty is provided, and contributors are not liable to you (the user of the library) for damages incurred through the use of this library. See LICENSE; 'Terms and Conditions' points 15 and 16 ('Disclaimer of Warranty' and 'Limitation of Liability respectively') for more information. - -## Examples & Benchmarks +## Examples & Benchmarks (WARNING: STALE) +#### NOTE: I'll redo these when i have time, im currently reimplementing the library due to some issues i encountered. They are still up here because i want to know what i need to beat performance-wise, and what benchmarks i included The library comes with a .NET Core 3.1 console project containing examples and benchmarks for the components of the library. The example project and a few benchmarks can be seen below: @@ -84,3 +59,4 @@ The following are the synchronous and asynchronous stream network writer (TCP) b [stream-network-reader-benchmark]: docs/stream-network-reader-benchmark.png [stream-network-writer-benchmark]: docs/stream-network-writer-benchmark.png + diff --git a/README.md.old b/README.md.old @@ -0,0 +1,76 @@ +# NetSharp + +A networking library written in C#, focusing on performance and built on top of SocketAsyncEventArgs. + +It is geared towards asynchronous and highly concurrent applications, which aim for maximum bandwidth. + +For help with the library, feel free to visit our Discord and ask any questions [here](https://discord.gg/DKQhxuY). + +| Service | Status Badge | +| ------- | ------------ | +| Discord | [![Discord Server][discord-server-badge]](https://discord.gg/DKQhxuY) | +| Code Quality | [![CodeFactor](https://www.codefactor.io/repository/github/mblenczewski/netsharp/badge/master)](https://www.codefactor.io/repository/github/mblenczewski/netsharp/overview/master) | +| CI Build | [![Build Status](https://quartzstudios.visualstudio.com/NetSharp/_apis/build/status/mblenczewski.NetSharp?branchName=master)](https://quartzstudios.visualstudio.com/NetSharp/_build/latest?definitionId=7&branchName=master) | + +The latest release build can be used by searching for NetSharp in the NuGet package manager. + +The latest unstable build, built from master at the time of the last commit, can be used either by adding the following XML snippet to your nuget.config (in the same folder as your .csproj or .sln) and restoring the package index: + +```xml +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <packageSources> + <add key="NetSharpFeed" value="https://quartzstudios.pkgs.visualstudio.com/NetSharp/_packaging/NetSharpFeed/nuget/v3/index.json" /> + </packageSources> +</configuration> +``` + +Or by adding the following package source in Visual Studio, with the source name 'NetSharpFeed' and source url 'https://quartzstudios.pkgs.visualstudio.com/NetSharp/_packaging/NetSharpFeed/nuget/v3/index.json', under Tools > Options > NuGet Package Manager > Package Sources. + +## Examples & Benchmarks + +The library comes with a .NET Core 3.1 console project containing examples and benchmarks for the components of the library. The example project and a few benchmarks can be seen below: + +### Example Project + +![Example Project 'Main Menu'][example-project] + +### Benchmarks + +#### Preface + +All the benchmarks were performed on a Ryzen 7 1700 CPU @ 3.20GHz. This library is built to be concurrent and to scale well with the number of execution threads available. The per-core clocks are also important though (when are they not?). + +During a benchmark 1,000,000 packets are sent per client by default, with a data segment size of 8192 bytes (8 kibibytes). This means that, by default, 8.192 gigabytes of user data are sent one way, and 8.192 are received (in the form of a response packet). The server is set up to simply echo any received packets, so packet processing overhead is virtually non-existent. Your mileage may vary. + +The RTT values measured are the very extremes of what you would get. When printing the RTT-per-packet, the maximum value is attained at the start of the connection and the minimum value seems to be sustained for the remainder of the connection. Again, your mileage may vary depending on the speed of your network, your packet loss (if using TCP), and the amount of packet processing you do on the server. The more processing you do, the longer your RTT times will be. + +### Datagram Network Reader & Writer Benchmarks + +The following is the datagram network listener (UDP) benchmark: + +![Datagram Network Reader Benchmark][datagram-network-reader-benchmark] + +The following are the synchronous and asynchronous datagram network writer (UDP) benchmarks. Worse performance is expected when compared to the synchronous benchmark, due to the increased overhead of async operations: + +![Datagram Network Writer Benchmark][datagram-network-writer-benchmark] + +### Stream Network Reader & Writer Benchmarks + +The following is the stream network listener (TCP) benchmark: + +![Stream Network Reader Benchmark][stream-network-reader-benchmark] + +The following are the synchronous and asynchronous stream network writer (TCP) benchmarks. Worse performance is expected when compared to the synchronous benchmark, due to the increased overhead of async operations: + +![Stream Network Writer Benchmark][stream-network-writer-benchmark] + +[discord-server-badge]: https://img.shields.io/discord/703255900600795196.svg?style=flat-square&logo=discord&color=blue + +[example-project]: docs/example-selector.png + +[datagram-network-reader-benchmark]: docs/datagram-network-reader-benchmark.png +[datagram-network-writer-benchmark]: docs/datagram-network-writer-benchmark.png + +[stream-network-reader-benchmark]: docs/stream-network-reader-benchmark.png +[stream-network-writer-benchmark]: docs/stream-network-writer-benchmark.png diff --git a/_config.yml b/_config.yml @@ -1 +0,0 @@ -theme: jekyll-theme-cayman -\ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml @@ -1,133 +0,0 @@ -trigger: -- master - -pool: - vmImage: 'windows-latest' - -variables: - major: '0' - minor: '1' - patch: '0' - nugetConnName: 'NetSharp NuGet Connection' - nugetApiKey: $(NetSharp_NuGet_Api_Key) - -steps: - -- task: DotNetCoreCLI@2 - displayName: 'NuGet Restore' - inputs: - command: 'restore' - projects: '**/*.csproj' - feedsToUse: 'select' - vstsFeed: 'f9dc36eb-1775-45c6-a7f2-64cb96034463/ddde3a7f-a830-43ac-a25a-3fde3da1abcf' - -- task: DotNetCoreCLI@2 - displayName: 'Debug Build' - continueOnError: true - inputs: - command: 'build' - projects: '**/*.csproj' - arguments: '--configuration Debug' - -- task: DotNetCoreCLI@2 - displayName: 'Release Build' - continueOnError: true - inputs: - command: 'build' - projects: '**/*.csproj' - arguments: '--configuration Release' - -## Discord webhook to report build status -- task: ado-discord-webhook@1 - displayName: 'Discord Successful Build Webhook' - condition: eq(variables['Agent.JobStatus'], 'Succeeded') - inputs: - channelId: '720999005181575198' - webhookKey: 'SlpZzjgTkvvl5dL4Ih_woGvPZj4qc2dTp1Oey9FMKkbjq2mrKMpkzqvGk8TtPzba2iMn' - name: 'Azure Pipelines' - avatar: 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Favatars.slack-edge.com%2F2019-01-17%2F528389819366_e7a0672f0480b3e98d21_512.png&f=1&nofb=1' - messageType: 'content' - content: '[Build $(Build.BuildId)](https://github.com/mblenczewski/NetSharp/commit/$(Build.SourceVersion)) OS=$(Agent.OS), Arch=$(Agent.OSArchitecture), Status=**Success**' - -- task: ado-discord-webhook@1 - displayName: 'Discord Failed Build Webhook' - condition: eq(variables['Agent.JobStatus'], 'SucceededWithIssues') - inputs: - channelId: '720999005181575198' - webhookKey: 'SlpZzjgTkvvl5dL4Ih_woGvPZj4qc2dTp1Oey9FMKkbjq2mrKMpkzqvGk8TtPzba2iMn' - name: 'Azure Pipelines' - avatar: 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Favatars.slack-edge.com%2F2019-01-17%2F528389819366_e7a0672f0480b3e98d21_512.png&f=1&nofb=1' - messageType: 'content' - content: '[Build $(Build.BuildId)](https://github.com/mblenczewski/NetSharp/commit/$(Build.SourceVersion)) OS=$(Agent.OS), Arch=$(Agent.OSArchitecture), Status=**Failure**' - -- task: DotNetCoreCLI@2 - displayName: 'Tests' - continueOnError: true - inputs: - command: 'test' - projects: '**/NetSharp.Tests.csproj' - -## Discord webhook to report test status -- task: ado-discord-webhook@1 - displayName: 'Discord Successful Test Webhook' - condition: eq(variables['Agent.JobStatus'], 'Succeeded') - inputs: - channelId: '720999005181575198' - webhookKey: 'SlpZzjgTkvvl5dL4Ih_woGvPZj4qc2dTp1Oey9FMKkbjq2mrKMpkzqvGk8TtPzba2iMn' - name: 'Azure Pipelines' - avatar: 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Favatars.slack-edge.com%2F2019-01-17%2F528389819366_e7a0672f0480b3e98d21_512.png&f=1&nofb=1' - messageType: 'content' - content: '[Test $(Build.BuildId)](https://github.com/mblenczewski/NetSharp/commit/$(Build.SourceVersion)) OS=$(Agent.OS), Arch=$(Agent.OSArchitecture), Status=**Success**' - -- task: ado-discord-webhook@1 - displayName: 'Discord Failed Test Webhook' - condition: eq(variables['Agent.JobStatus'], 'SucceededWithIssues') - inputs: - channelId: '720999005181575198' - webhookKey: 'SlpZzjgTkvvl5dL4Ih_woGvPZj4qc2dTp1Oey9FMKkbjq2mrKMpkzqvGk8TtPzba2iMn' - name: 'Azure Pipelines' - avatar: 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Favatars.slack-edge.com%2F2019-01-17%2F528389819366_e7a0672f0480b3e98d21_512.png&f=1&nofb=1' - messageType: 'content' - content: '[Test $(Build.BuildId)](https://github.com/mblenczewski/NetSharp/commit/$(Build.SourceVersion)) OS=$(Agent.OS), Arch=$(Agent.OSArchitecture), Status=**Failure**' - -## We only want to build the NetSharp project, not the NetSharpExamples project. -## Users should clone the repo to run the examples. -- task: DotNetCoreCLI@2 - displayName: 'NuGet Pack' - condition: eq(variables['Agent.JobStatus'], 'Succeeded') - inputs: - command: 'pack' - packagesToPack: '**/NetSharp.csproj' - includesymbols: true - includesource: true - versioningScheme: 'byPrereleaseNumber' - majorVersion: '$(major)' - minorVersion: '$(minor)' - patchVersion: '$(patch)' - -## Publishing to Azure Artifacts -- task: NuGetAuthenticate@0 - displayName: 'NuGet Publish Authentication' - condition: eq(variables['Agent.JobStatus'], 'Succeeded') - inputs: - forceReinstallCredentialProvider: true - -- task: NuGetCommand@2 - displayName: 'NuGet Push' - condition: eq(variables['Agent.JobStatus'], 'Succeeded') - inputs: - command: 'push' - packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;$(Build.ArtifactStagingDirectory)/**/*.snupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' - nuGetFeedType: 'internal' - noCache: true - disableParallelProcessing: true - publishVstsFeed: 'f9dc36eb-1775-45c6-a7f2-64cb96034463/ddde3a7f-a830-43ac-a25a-3fde3da1abcf' - -- task: PublishSymbols@2 - displayName: 'NuGet Push Symbols' - condition: eq(variables['Agent.JobStatus'], 'Succeeded') - inputs: - SearchPattern: '**/bin/**/*.pdb' - SymbolServerType: 'TeamServices' - TreatNotIndexedAsWarning: true - SymbolsVersion: '2.\*' -\ No newline at end of file