/// <summary> /// Checks whether the server is alive (throws an exception if not). /// </summary> public void Ping() { var messageEncoderSettings = GetMessageEncoderSettings(); var operation = new PingOperation(messageEncoderSettings); var server = GetServer(); using (var binding = new SingleServerReadBinding(server, ReadPreference.PrimaryPreferred)) { operation.Execute(binding, CancellationToken.None); } }
/// <summary> /// Checks whether the server is alive (throws an exception if not). /// </summary> public void Ping() { var messageEncoderSettings = GetMessageEncoderSettings(); var operation = new PingOperation(messageEncoderSettings); var server = GetServer(); using (var channelSource = new ChannelSourceHandle(new ServerChannelSource(server))) using (var channelSourceBinding = new ChannelSourceReadWriteBinding(channelSource, ReadPreference.PrimaryPreferred)) { operation.Execute(channelSourceBinding, CancellationToken.None); } }