https://github.com/horse-framework/horse-server
TCP server and core modules for horse framework libraries
https://github.com/horse-framework/horse-server
protocols protocolserver server tcp
Last synced: 3 months ago
JSON representation
TCP server and core modules for horse framework libraries
- Host: GitHub
- URL: https://github.com/horse-framework/horse-server
- Owner: horse-framework
- License: apache-2.0
- Created: 2020-07-12T16:48:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-11-23T13:45:46.000Z (about 2 years ago)
- Last Synced: 2025-02-03T12:15:31.427Z (12 months ago)
- Topics: protocols, protocolserver, server, tcp
- Language: C#
- Homepage:
- Size: 130 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Horse Server
[](https://www.nuget.org/packages/Horse.Server)
Horse Server is a TCP Server and includes Core modules for Horse Framework Libraries.
Only use Horse Server directly if you develop new protocol extension for horse server.
If you are looking for Messaging Queue Server, HTTP Server with MVC Architecture, WebSocket Server/Client or IOC Library, you can check other repositories of Horse Framework.
### Usage
HorseServer is an object, accepts TCP requests and finds the protocol which accepts the request. Here is a quick example which is used for accepting websocket connections used in horse websocket library.
public class ServerWsHandler : IProtocolConnectionHandler
{
...
}
...
ServerWsHandler handler = new ServerWsHandler();
HorseServer server = new HorseServer(ServerOptions.CreateDefault());
server.UseWebSockets(handler);
server.Start();
UseWebSockets is an extension method. If you need to add another protocol, you can create your own extension method that calls HorseServer's UseProtocol method. Or you can just add protocol to the server like this:
public class CustomProtocol : IHorseProtocol
{
...
}
...
server.UseProtocol(new CustomProtocol());
## Thanks
Thanks to JetBrains for open source license to use on this project.
[](https://www.jetbrains.com/?from=twino-framework)