Пример #1
0
 public void TearDown()
 {
     _serverSessionFactory     = null;
     _socketAcceptorFactory    = null;
     _packetScheduler          = null;
     _rollingIvFactoryProvider = null;
     _ivGenerator = null;
     _logger      = null;
 }
Пример #2
0
        public void SetUp()
        {
            this.serverSessionFactory = Mock.Of<IServerSessionFactory>();

            var socketAcceptorFactoryMock = new Mock<ISocketAcceptorFactory>();
            socketAcceptorFactoryMock
                .Setup(saf => saf.CreateSocketAcceptor(It.IsAny<IPEndPoint>()))
                .Returns<IPEndPoint>(endpoint => new SocketAcceptor(endpoint));
            this.socketAcceptorFactory = socketAcceptorFactoryMock.Object;

            this.packetScheduler = Mock.Of<IPacketScheduler>();
            this.rollingIvFactoryProvider = Mock.Of<IRollingIvFactoryProvider>();
            this.ivGenerator = new IvGenerator(new RNGCryptoServiceProvider());
            this.logger = Mock.Of<ILogger>();
        }
Пример #3
0
        public void SetUp()
        {
            _serverSessionFactory = Mock.Of <IServerSessionFactory>();

            var socketAcceptorFactoryMock = new Mock <ISocketAcceptorFactory>();

            socketAcceptorFactoryMock
            .Setup(saf => saf.CreateSocketAcceptor(It.IsAny <IPEndPoint>()))
            .Returns <IPEndPoint>(endpoint => new SocketAcceptor(endpoint));
            _socketAcceptorFactory = socketAcceptorFactoryMock.Object;

            _packetScheduler          = Mock.Of <IPacketScheduler>();
            _rollingIvFactoryProvider = Mock.Of <IRollingIvFactoryProvider>();
            _ivGenerator = new IvGenerator(new RNGCryptoServiceProvider());
            _logger      = Mock.Of <ILogger>();
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServerProcess"/> class.
        /// </summary>
        public ServerProcess(
            IServerSessionFactory sessionFactory,
            ISocketAcceptorFactory socketAcceptorFactory,
            IPacketScheduler packetScheduler,
            IRollingIvFactoryProvider rollingIvFactoryProvider,
            IvGenerator ivGenerator,
            ILogger logger)
        {
            _sessionFactory           = sessionFactory;
            _socketAcceptorFactory    = socketAcceptorFactory;
            _packetScheduler          = packetScheduler;
            _rollingIvFactoryProvider = rollingIvFactoryProvider;
            _ivGenerator = ivGenerator;
            _logger      = logger;

            _isConfigured = false;
            _isDisposed   = false;
            _isRunning    = new AtomicBoolean(false);
        }
Пример #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServerProcess"/> class.
        /// </summary>
        public ServerProcess(
            IServerSessionFactory sessionFactory,
            ISocketAcceptorFactory socketAcceptorFactory,
            IPacketScheduler packetScheduler,
            IRollingIvFactoryProvider rollingIvFactoryProvider,
            IvGenerator ivGenerator,
            ILogger logger)
        {
            this.sessionFactory = sessionFactory;
            this.socketAcceptorFactory = socketAcceptorFactory;
            this.packetScheduler = packetScheduler;
            this.rollingIvFactoryProvider = rollingIvFactoryProvider;
            this.ivGenerator = ivGenerator;
            this.logger = logger;

            this.isConfigured = false;
            this.isDisposed = false;
            this.isRunning = new AtomicBoolean(false);
        }
Пример #6
0
 public void TearDown()
 {
     this.serverSessionFactory = null;
     this.socketAcceptorFactory = null;
     this.packetScheduler = null;
     this.rollingIvFactoryProvider = null;
     this.ivGenerator = null;
     this.logger = null;
 }