百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

NetCoreServer

> 数据库
开源

超快速、低延迟的异步套接字服务器和客户端 C# .NET Core 库,支持 TCP、SSL、UDP、HTTP、HTTPS、WebSocket 协议以及 10K 连接。

3.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

超快速、低延迟的异步套接字服务器和客户端 C# .NET Core 库,支持 TCP、SSL、UDP、HTTP、HTTPS、WebSocket 协议以及 10K 连接。

NetCoreServer


Ultra fast and low latency asynchronous socket server & client C# .NET Core library with support TCP, SSL, UDP, Unix Domain Socket, HTTP, HTTPS, WebSocket protocols and [10K connections problem](https://en.wikipedia.org/wiki/C10k_problem) solution.

Has integration with high-level message protocol based on Fast Binary Encoding

NetCoreServer documentation
NetCoreServer downloads

Contents

  • Features
  • Requirements
  • How to build?
  • Examples
    • Example: TCP chat server
    • Example: TCP chat client
    • Example: SSL chat server
    • Example: SSL chat client
    • Example: UDP echo server
    • Example: UDP echo client
    • Example: UDP multicast server
    • Example: UDP multicast client
    • Example: Unix Domain Socket chat server
    • Example: Unix Domain Socket chat client
    • Example: Simple protocol
    • Example: Simple protocol server
    • Example: Simple protocol client
    • Example: HTTP server
    • Example: HTTP client
    • Example: HTTPS server
    • Example: HTTPS client
    • Example: WebSocket chat server
    • Example: WebSocket chat client
    • Example: WebSocket secure chat server
    • Example: WebSocket secure chat client
  • Performance
    • Benchmark: Round-Trip
      • TCP echo server
      • SSL echo server
      • UDP echo server
      • Unix Domain Socket echo server
      • Simple protocol server
      • WebSocket echo server
      • WebSocket secure echo server
    • Benchmark: Multicast
      • TCP multicast server
      • SSL multicast server
      • UDP multicast server
      • Unix Domain Socket multicast server
      • WebSocket multicast server
      • WebSocket secure multicast server
    • Benchmark: Web Server
      • HTTP Trace server
      • HTTPS Trace server
  • OpenSSL certificates
    • Production
    • Development
    • Certificate Authority
    • SSL Server certificate
    • SSL Client certificate
    • Diffie-Hellman key exchange

Features

  • Cross platform (Linux, MacOS, Windows)
  • Asynchronous communication
  • Supported transport protocols: TCP, SSL, UDP, UDP multicast, Unix Domain Socket
  • Supported Web protocols: HTTP, HTTPS, WebSocket, WebSocket secure
  • Supported Swagger OpenAPI iterative documentation
  • Supported message protocol based on Fast Binary Encoding

Requirements

  • Linux
  • MacOS
  • Windows
  • .NET 6.0
  • 7-Zip
  • cmake
  • git
  • Visual Studio

Optional:

  • Rider

How to build?

Setup repository

git clone https://github.com/chronoxor/NetCoreServer.git
cd NetCoreServer

Linux

cd build
./unix.sh

MacOS

cd build
./unix.sh

Windows (Visual Studio)

Open and build NetCoreServer.sln or run the build script:

cd build
vs.bat

The build script will create "release" directory with zip files:

  • NetCoreServer.zip - C# Server assembly
  • Benchmarks.zip - C# Server benchmarks
  • Examples.zip - C# Server examples

Examples

Example: TCP chat server

Here comes the example of the TCP chat server. It handles multiple TCP client sessions and multicast received message from any session to all ones. Also it is possible to send admin message directly from the server.

…

Example: TCP chat client

Here comes the example of the TCP chat client. It connects to the TCP chat server and allows to send message to it and receive new messages.

…

Example: SSL chat server

Here comes the example of the SSL chat server. It handles multiple SSL client sessions and multicast received message from any session to all ones. Also it is possible to send admin message directly from the server.

This example is very similar to the TCP one except the code that prepares SSL context and handshake handler.

…

Example: SSL chat client

Here comes the example of the SSL chat client. It connects to the SSL chat server and allows to send message to it and receive new messages.

This example is very similar to the TCP one except the code that prepares SSL context and handshake handler.

…

Example: UDP echo server

Here comes the example of the UDP echo server. It receives a datagram mesage from any UDP client and resend it back without any changes.

…

Example: UDP echo client

Here comes the example of the UDP echo client. It sends user datagram message to UDP server and listen for response.

…

Example: UDP multicast server

Here comes the example of the UDP multicast server. It use multicast IP address to multicast datagram messages to all client that joined corresponding UDP multicast group.

…

Example: UDP multicast client

Here comes the example of the UDP multicast client. It use multicast IP address and joins UDP multicast group in order to receive multicasted datagram messages from UDP server.

…

Example: Unix Domain Socket chat server

Here comes the example of the Unix Domain Socket chat server. It handles multiple Unix Domain Socket client sessions and multicast received message from any session to all ones. Also it is possible to send admin message directly from the server.

…

Example: Unix Domain Socket chat client

Here comes the example of the Unix Domain Socket chat client. It connects to the Unix Domain Socket chat server and allows to send message to it and receive new messages.

…

Example: Simple protocol

Simple protocol is defined in simple.fbe file:

…

Example: Simple protocol server

Here comes the example of the simple protocol server. It process client requests, answer with corresponding responses and send server notifications back to clients.

…

Example: Simple protocol client

Here comes the example of the simple protocol client. It connects to the simple protocol server and allows to send requests to it and receive corresponding responses.

…

Example: HTTP server

Here comes the example of the HTTP cache server. It allows to manipulate cache data with HTTP methods (GET, POST, PUT and DELETE).

Use the following link to open Swagger OpenAPI iterative documentation: http://localhost:8080/api/index.html

…

Example: HTTP client

Here comes the example of the HTTP client. It allows to send HTTP requests (GET, POST, PUT and DELETE) and receive HTTP responses.

…

Example: HTTPS server

Here comes the example of the HTTPS cache server. It allows to manipulate cache data with HTTP methods (GET, POST, PUT and DELETE) with secured transport protocol.

Use the following link to open Swagger OpenAPI iterative documentation: https://localhost:8443/api/index.html

…

Example: HTTPS client

Here comes the example of the HTTPS client. It allows to send HTTP requests (GET, POST, PUT and DELETE) and receive HTTP responses with secured transport protocol.

…

Example: WebSocket chat server

Here comes the example of the WebSocket chat server. It handles multiple WebSocket client sessions and multicast received message from any session to all ones. Also it is possible to send admin message directly from the server.

Use the following link to open WebSocket chat server example: http://localhost:8080/chat/index.html

…

Example: WebSocket chat client

Here comes the example of the WebSocket chat client. It connects to the WebSocket chat server and allows to send message to it and receive new messages.

…

Example: WebSocket secure chat server

Here comes the example of the WebSocket secure chat server. It handles multiple WebSocket secure client sessions and multicast received message from any session to all ones. Also it is possible to send admin message directly from the server.

This example is very similar to the WebSocket one except the code that prepares WebSocket secure context and handshake handler.

Use the following link to open WebSocket secure chat server example: https://localhost:8443/chat/index.html

…

Example: WebSocket secure chat client

Here comes the example of the WebSocket secure chat client. It connects to the WebSocket secure chat server and allows to send message to it and receive new messages.

This example is very similar to the WebSocket one except the code that prepares WebSocket secure context and handshake handler.

…

Performance

Here comes several communication scenarios with timing measurements.

Benchmark environment is the following:

CPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
CPU logical cores: 8
CPU physical cores: 4
CPU clock speed: 3.998 GHz
CPU Hyper-Threading: enabled
RAM total: 31.962 GiB
RAM free: 24.011 GiB

OS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit
OS bits: 64-bit
Process bits: 64-bit
Process configuaraion: release

Benchmark: Round-Trip

This scenario sends lots of messages from several clients to a server. The server responses to each message and resend the similar response to the client. The benchmark measures total round-trip time to send all messages and receive all responses, messages & data throughput, count of errors.

TCP echo server

  • TcpEchoServer
  • TcpEchoClient --clients 1
Server address: 127.0.0.1
Server port: 1111
Working clients: 1
Working messages: 1000
Message size: 32
Seconds to benchmarking: 10

Errors: 0

Total time: 10.024 s
Total data: 2.831 GiB
Total messages: 94369133
Data throughput: 287.299 MiB/s
Message latency: 106 ns
Message throughput: 9413997 ms

Issues· 184 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#asynchttphttp-serverhttps

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库