public SchSendAuxRecordTestServer(X509Certificate serverCertificate, int port = 0)
 {
     _serverCertificate = serverCertificate;
     _port = port;
     _log = VerboseTestLogging.GetInstance();
     AuxRecordDetected = false;
 }
Beispiel #2
0
 public HttpsTestServer(X509Certificate serverCertificate, SslProtocols acceptedProtocols = SslProtocols.Tls)
 {
     _serverCertificate = serverCertificate;
     _protocols = acceptedProtocols;
     _log = VerboseTestLogging.GetInstance();
     AuxRecordDetected = false;
 }
        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);
        }
Beispiel #4
0
        public DummyTcpServer(IPEndPoint endPoint, EncryptionPolicy? sslEncryptionPolicy)
        {
            _log = VerboseTestLogging.GetInstance();

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

            StartListener(endPoint);
        }
        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 SchSendAuxRecordTestClient(string server, int port)
 {
     _server = server;
     _port = port;
     _log = VerboseTestLogging.GetInstance();
 }