- server now reads continiously instead of polling

- server increases reading delay when client is inactive
- new procedure to check if the client is connected or not
- ftphandler sets affinity to connected client
This commit is contained in:
Alexandru Macocian
2020-04-10 21:44:40 +02:00
parent e5ccfff5da
commit 71cc470569
7 changed files with 137 additions and 62 deletions
+6 -5
View File
@@ -1,4 +1,6 @@
using MTSC.Common.Ftp.FtpModules;
using MTSC.Common.Http.RoutingModules;
using MTSC.Common.Http.ServerModules;
using MTSC.Exceptions;
using MTSC.Logging;
using MTSC.ServerSide;
@@ -13,19 +15,18 @@ namespace MTSC_TestServer
{
static void Main(string[] args)
{
Server server = new Server(443);
Server server = new Server(800);
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(1024);
server
.WithCertificate(new X509Certificate2("powershellcert.pfx", "123"))
//.WithCertificate(new X509Certificate2("powershellcert.pfx", "123"))
.AddLogger(new ConsoleLogger())
.AddLogger(new DebugConsoleLogger())
.AddServerUsageMonitor(new TickrateEnforcer()
.SetTicksPerSecond(60)
.SetSilent(true))
.AddExceptionHandler(new ExceptionConsoleLogger())
//.AddHandler(new WebsocketHandler())
//.AddHandler(new HttpHandler().AddHttpModule(new FileServerModule())
// .AddHttpModule(new PostModule()))
.AddHandler(new HttpRoutingHandler()
.AddRoute(MTSC.Common.Http.HttpMessage.HttpMethods.Get, "hello", new Http200Module()))
.AddHandler(new FtpHandler()
.AddModule(new AuthenticationModule())
.AddModule(new SystModule())