public HttpServer(LibNetworkConfig config) { Config = config; SessionFactory = config.Factories.TcpSessionFactoryFactory(config); Sessions = new ConcurrentDictionary <Guid, IHttpSession>(); SessionTasks = new ConcurrentDictionary <Guid, Task>(); OnNewConnection = delegate { return(Task.CompletedTask); }; OnUnhandledException = delegate { return(Task.CompletedTask); }; OnSessionException = delegate { return(Task.CompletedTask); }; OnSocketException = delegate { return(Task.CompletedTask); }; }
public TcpClientHandler( ISslService sslService, ITcpSessionFactory tcpSessionFactory, IWatchDog tcpWatchDog, TcpSettings tcpSettings) { Validation.RequireValidTcpSettings(tcpSettings); _sslService = sslService ?? throw new ArgumentNullException(nameof(sslService)); _tcpSessionFactory = tcpSessionFactory ?? throw new ArgumentNullException(nameof(tcpSessionFactory)); _tcpWatchDog = tcpWatchDog ?? throw new ArgumentNullException(nameof(tcpWatchDog)); _tcpWatchDog.MaxSessionDuration = tcpSettings.IdleTimeout; _tcpSettings = tcpSettings; }