private TestServer CreateTestServer(Action <TestServerOptions> configure = null)
        {
            TestServerOptions options = CreateOptions();

            configure?.Invoke(options);
            return(new TestServer(options));
        }
        public TestServer(TestServerOptions options = null)
        {
            options = options ?? new TestServerOptions();
            _connectionDispatcher = options.ConnectionDispatcher;
            var transportOptions = new LinuxTransportOptions()
            {
                ThreadCount = options.ThreadCount,
                DeferAccept = options.DeferAccept,
                AioReceive  = options.AioReceive,
                AioSend     = options.AioSend,
                ApplicationSchedulingMode = options.ApplicationSchedulingMode,
            };
            var      loggerFactory = new LoggerFactory();
            EndPoint endPoint      = null;

            if (options.UnixSocketPath != null)
            {
                _unixSocketPath = options.UnixSocketPath;
                endPoint        = new UnixDomainSocketEndPoint(_unixSocketPath);
            }
            else
            {
                _serverAddress = options.IPEndPoint ?? new IPEndPoint(IPAddress.Loopback, 0);
                endPoint       = _serverAddress;
            }
            _transport = new Transport(endPoint, transportOptions, loggerFactory);
        }
        public TestServer(TestServerOptions options = null)
        {
            options            = options ?? new TestServerOptions();
            _connectionHandler = options.ConnectionHandler;
            _serverAddress     = new IPEndPoint(IPAddress.Loopback, 0);
            var transportOptions = new LinuxTransportOptions()
            {
                ThreadCount = options.ThreadCount,
                DeferAccept = options.DeferAccept
            };
            var loggerFactory = new LoggerFactory();

            loggerFactory.AddConsole((n, l) => false);
            _transport = new Transport(_serverAddress, this, transportOptions, loggerFactory);
        }