private void PublishDisconnectedDescription(EndPoint endPoint)
        {
            var current = _serverFactory.GetServerDescription(endPoint);

            var description = new ServerDescription(current.ServerId, endPoint);

            _serverFactory.PublishDescription(description);
        }
Example #2
0
        private void PublishDisconnectedDescription(ICluster cluster, EndPoint endPoint)
        {
            var current = _serverFactory.GetServerDescription(endPoint);

            var serverDescription         = new ServerDescription(current.ServerId, endPoint);
            var currentClusterDescription = cluster.Description;

            _serverFactory.PublishDescription(serverDescription);
            SpinWait.SpinUntil(() => !object.ReferenceEquals(cluster.Description, currentClusterDescription), 100); // sometimes returns false and that's OK
        }
        private void PublishDescription(EndPoint endPoint, ServerType serverType)
        {
            var current = _mockServerFactory.GetServerDescription(endPoint);

            var description = current.With(
                state: ServerState.Connected,
                type: serverType);

            _mockServerFactory.PublishDescription(description);
        }
        private void PublishDescription(EndPoint endPoint, ServerType serverType, ReplicaSetConfig replicaSetConfig = null)
        {
            var current = _mockServerFactory.GetServerDescription(endPoint);

            var description = current.With(
                state: ServerState.Connected,
                type: serverType,
                replicaSetConfig: replicaSetConfig);

            _mockServerFactory.PublishDescription(description);
        }