Ejemplo n.º 1
0
        public void Connect()
        {
            _connection = _connector.CreateTcpConnection(OnPackageReceived, OnConnectionEstablished, OnConnectionClosed);

            if (_executionThread == null)
            {
                _executionThread = new Thread(ExecuteUserCallbacks)
                {
                    IsBackground = true,
                    Name         = "SubscriptionsChannel user callbacks thread"
                };
                _executionThread.Start();
            }
        }
Ejemplo n.º 2
0
        private void Connect(IPEndPoint endPoint)
        {
            _connection = _connector.CreateTcpConnection(endPoint, OnPackageReceived, OnConnectionEstablished, OnConnectionClosed);

            if (_executionThread == null)
            {
                _stopExecutionThread = false;
                _executionThread     = new Thread(ExecuteUserCallbacks)
                {
                    IsBackground = true,
                    Name         = "SubscriptionsChannel user callbacks thread"
                };
                _executionThread.Start();
            }
        }
Ejemplo n.º 3
0
        public EventStoreConnection(IPEndPoint tcpEndPoint)
        {
            Ensure.NotNull(tcpEndPoint, "tcpEndPoint");

            _tcpEndPoint = tcpEndPoint;
            _connector = new TcpConnector(_tcpEndPoint);
            _outstandingOperations = new ConcurrentDictionary<Guid, ITaskCompletionWrapper>();

            _lastReconnectionTimestamp = DateTime.UtcNow;
            _connection = _connector.CreateTcpConnection(OnPackageReceived, ConnectionEstablished, ConnectionClosed);
            _timeoutCheckStopwatch.Start();

            _monitoringThread = new Thread(MonitoringLoop)
            {
                IsBackground = true,
                Name = string.Format("Monitoring thread")
            };
            _monitoringThread.Start();
        }