Hydra is a high-performance, multi-channel TCP server written on C#. It is designed to handle a massive number of concurrent client connections—tested successfully with up to 50,000 simultaneous clients. Its key feature is the ability to manage multiple listening sockets (server sockets) within a single server instance, making it a true multi-channel communication hub.
asynchronous I/O and optimized for minimal resource consumption under heavy load.TLS (X509 certificates) for preventing data from being captured by snifferExample starting TCP-server without TLS:
// 1. Create Server cofifuration
ServerChannelConfiguration mainInsecureChannel = new ServerChannelConfiguration()
{
IpAddress = "127.0.0.1",
Port = 23456,
IsSecure = false
};
ITcpServer server = new MultiChannelTcpServer(new[] { mainInsecureChannel }, new NullLoggerFactory(), null, null);
// Example Echo server with data reverse
server.AssignHandler( async (d, c) =>
{
string msg = System.Text.Encoding.Default.GetString(d);
return d.Reverse().ToArray();
});
OperationResult startResult = await server.StartAsync();
// ...
OperationResult stopResult = await server.StopAsync();
Hydra has been load-tested to handle up to 50000 concurrent client connections across its channels. Performance metrics depend on hardware, network configuration, and the workload (e.g., message frequency, size). Tests could be running in a Docker container as follows:
docker build -t hydra.tests -f .\test.Dockerfile .docker run -i -t hydra.tests UDPTCP and UDP50000 of clientsContributions are welcome! Please feel free to submit a Pull Request:
git checkout -b feature/AmazingFeature).git commit -m 'Add some AmazingFeature').git push origin feature/AmazingFeature).Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
Wissance.Hydra contributors