Exemple #1
0
 public HttpsTestServer(X509Certificate serverCertificate, SslProtocols acceptedProtocols = SslProtocols.Tls)
 {
     _serverCertificate = serverCertificate;
     _protocols         = acceptedProtocols;
     _log = VerboseTestLogging.GetInstance();
     AuxRecordDetected = false;
 }
Exemple #2
0
 public SchSendAuxRecordTestServer(X509Certificate serverCertificate, int port = 0)
 {
     _serverCertificate = serverCertificate;
     _port             = port;
     _log              = VerboseTestLogging.GetInstance();
     AuxRecordDetected = false;
 }
Exemple #3
0
        public SocketTestServerAPM(int numConnections, int receiveBufferSize, EndPoint localEndPoint)
        {
            _log = VerboseTestLogging.GetInstance();
            _receiveBufferSize = receiveBufferSize;

            _socket = new Socket(localEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
            _socket.Bind(localEndPoint);
            _socket.Listen(numConnections);

            _socket.BeginAccept(OnAccept, null);
        }
Exemple #4
0
        public DummyTcpServer(IPEndPoint endPoint, EncryptionPolicy?sslEncryptionPolicy)
        {
            _log = VerboseTestLogging.GetInstance();

            if (sslEncryptionPolicy != null)
            {
                _remoteEndPoint      = endPoint;
                _useSsl              = true;
                _sslEncryptionPolicy = (EncryptionPolicy)sslEncryptionPolicy;
            }

            StartListener(endPoint);
        }
Exemple #5
0
        public SocketTestServerAsync(int numConnections, int receiveBufferSize, EndPoint localEndPoint)
        {
            _log                 = VerboseTestLogging.GetInstance();
            _totalBytesRead      = 0;
            _numConnectedSockets = 0;
            _maxNumConnections   = numConnections;
            _receiveBufferSize   = receiveBufferSize;

            // Allocate buffers such that the maximum number of sockets can have one outstanding read and
            // write posted to the socket simultaneously.
            _bufferManager = new BufferManager(receiveBufferSize * numConnections * OpsToPreAlloc,
                                               receiveBufferSize);

            _readWritePool = new SocketAsyncEventArgsPool(numConnections);
            _maxNumberAcceptedClientsSemaphore = new Semaphore(numConnections, numConnections);
            Init();
            Start(localEndPoint);
        }
 public ServerAsyncAuthenticateTest(ITestOutputHelper output)
 {
     _log               = output;
     _logVerbose        = VerboseTestLogging.GetInstance();
     _serverCertificate = Configuration.Certificates.GetServerCertificate();
 }
 public ServerAsyncAuthenticateTest()
 {
     _log               = TestLogging.GetInstance();
     _logVerbose        = VerboseTestLogging.GetInstance();
     _serverCertificate = Configuration.Certificates.GetServerCertificate();
 }
 public SchSendAuxRecordTestClient(string server, int port)
 {
     _server = server;
     _port   = port;
     _log    = VerboseTestLogging.GetInstance();
 }