https://github.com/oslboreal/borealserver
Simple client server library with, asynchronous and socket working.
https://github.com/oslboreal/borealserver
asynchronous client core free net open server
Last synced: 5 months ago
JSON representation
Simple client server library with, asynchronous and socket working.
- Host: GitHub
- URL: https://github.com/oslboreal/borealserver
- Owner: oslboreal
- License: mit
- Created: 2019-08-01T20:41:02.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T05:55:37.000Z (over 3 years ago)
- Last Synced: 2025-12-18T13:19:53.362Z (6 months ago)
- Topics: asynchronous, client, core, free, net, open, server
- Language: C#
- Homepage:
- Size: 9.93 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BorealCore Server!
BorealCoreServer is a simple, asynchronous, multithreading and **socket based** server library.
[](https://www.nuget.org/packages/BorealCoreServer/)
# How to start?
Code snippet.
// Received request handler.
CoreServer.Server.receivedRequestEvent += ProcessReceivedRequest;
// Server start.
CoreServer.Server.Instance.Start();
You may process a request using an event handler like ProcessReceivedRequest. BorealCoreServer is a core library so, you must to manage the handler socket and Close the communication once you are done, to do this the server instance provides you Close(Socket handler) method.
public static void ProcessReceivedRequest(Socket handler, string request)
{
try
{
MycustomAction(handler, request);
if (request.Contains("message"))
DoSomething();
}
catch (Exception ex)
{
LoggingComponent.Log($"{ex.Message} - Stack: {ex.StackTrace}", LogType.Error);
}
finally
{
LoggingComponent.Log($"Request received from: {handler}", LogType.Succes);
if (handler.Connected)
handler.Close();
}
}
## Configuration
BorealCoreServer will create a Configuration folder in your Environment.CurrentDirectory
This folder will contain some json files and you will be able to set your own custom configuration (ip, port, logging paths, etc.)
```