Пример #1
0
        private void AddAndStartOutgoingReplication(ReplicationNode node, bool external)
        {
            var info = GetConnectionInfo(node, external);

            if (info == null)
            {
                // this means that we were unable to retrive the tcp connection info and will try it again later
                return;
            }
            var outgoingReplication = new OutgoingReplicationHandler(this, Database, node, external, info);

            outgoingReplication.Failed += OnOutgoingSendingFailed;
            outgoingReplication.SuccessfulTwoWaysCommunication += OnOutgoingSendingSucceeded;
            _outgoing.TryAdd(outgoingReplication); // can't fail, this is a brand new instance

            outgoingReplication.Start();

            OutgoingReplicationAdded?.Invoke(outgoingReplication);
        }
Пример #2
0
        private void AddAndStartOutgoingReplication(ReplicationNode node, bool external)
        {
            var outgoingReplication = new OutgoingReplicationHandler(this, Database, node, external);

            outgoingReplication.Failed += OnOutgoingSendingFailed;
            outgoingReplication.SuccessfulTwoWaysCommunication += OnOutgoingSendingSucceeded;
            _outgoing.TryAdd(outgoingReplication); // can't fail, this is a brand new instance

            node.Url = node.Url.Trim();

            _outgoingFailureInfo.TryAdd(node, new ConnectionShutdownInfo
            {
                Node     = node,
                External = external
            });
            outgoingReplication.Start();

            OutgoingReplicationAdded?.Invoke(outgoingReplication);
        }