Mamemaki.Newconn
1.0.2
dotnet add package Mamemaki.Newconn --version 1.0.2
NuGet\Install-Package Mamemaki.Newconn -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mamemaki.Newconn" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mamemaki.Newconn" Version="1.0.2" />
<PackageReference Include="Mamemaki.Newconn" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mamemaki.Newconn --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Mamemaki.Newconn, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mamemaki.Newconn@1.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mamemaki.Newconn&version=1.0.2
#tool nuget:?package=Mamemaki.Newconn&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Mamemaki.Newconn
Mamemaki.Newconn is a library for building reliable and high-performance TCP servers and clients for your own protocol.
It includes the following features:
- Protocol implementation
- Abstraction enables the quick and easy implementation of any proprietary protocol
- You can use your own connection class, which will allow you to use your custom protocol naturally
- Features that can be extended as middlewares
- TLS
- MaxConcurrentConnectionLimit
- Idle connections timeout
- Data sniffing for debugging
- Connection ID issuance
- Heartbeats
- Performance
- Based on the Kestrel socket connection implementation, which is the fastest c# web server
- Efficient handling of buffer management, backpressure and flow control via System.IO.Pipelines
- Efficient asynchronous processing and cancellation via TAP(Task-based Asynchronous Pattern)
- DI(Dependency Injection) support
- Diagnostics
- Logging support by Microsoft.Extensions.Logging
- Metrics collection support by System.Diagnostics.Metrics
Key components
* Star sign indicates the classes/methods that you need to implement.
- ��Client: This is a client class. It is just a wrapper of the connection. You whould implement your own client class by inheriting from this class. Using this class is optional. You can use the Connection class directly or via the client class. This class can be instantiated via Dependency Injection. This means that you can use DI services like DBContext within it. You can define business layer methods such as AuthenticateAsync in it.
- ��Connection: This class represents a connection. You will implement your own connection class by inheriting from this class. This class can only be instantiated by parameterless constructor. Within the class, you can send or receive your protocol messages by using your protocol class. Additionally, the connection class will be shared between Server and Client. This means that you can define common methods for both sides.
- ��Protocol: This is your protocol definition class. It handles the encoding and decoding of your protocol messages from the raw transfer data. This class is stateless. If you use the raw transfer data as-is, you do not need to implement it.
- TransportConnection: This class implements actual transfer processing, such as socket handling. Users would not usually use this class directly.
- NewconnServer: This is the server class. It manages all listeners and global settings.
- NewconnListener: This is a listener class. It accepts connections from endpoints, dispatches connection handlers, and manages accepted connection resources.
- ��ConnectionHandler: This is a connection handler method/class. You will implement the processing for the accepted connection. You can define business layer methods such as AuthenticateAsync in it.
Documentation
Benchmark
| Method | Framework | Mean | Error | StdDev | Allocated |
|---|---|---|---|---|---|
| Run | Kestrel | 60.80 ms | 0.202 ms | 0.179 ms | 1.88 MB |
| Run | Newconn | 60.79 ms | 0.214 ms | 0.190 ms | 1.88 MB |
| Run | SuperSocket | 65.75 ms | 0.502 ms | 0.469 ms | 8.02 MB |
See the Benchmarks for details.
Special thanks
This project is based on Kestrel and inspired following projects:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.Bcl.Cryptography (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- System.IO.Pipelines (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 120 | 7/14/2026 |