public void WithAddressFamily_returns_same_instance_if_value_is_equal() { var subject1 = new TcpStreamSettings(); var subject2 = subject1.WithAddressFamily(AddressFamily.InterNetwork); subject2.Should().BeSameAs(subject1); }
/// <summary> /// Configures the TCP stream settings. /// </summary> /// <param name="configurator">The TCP stream settings configurator delegate.</param> /// <returns>A reconfigured cluster builder.</returns> public ClusterBuilder ConfigureTcp(Func <TcpStreamSettings, TcpStreamSettings> configurator) { Ensure.IsNotNull(configurator, nameof(configurator)); _tcpStreamSettings = configurator(_tcpStreamSettings); return(this); }
public void WithReadTimeout_returns_same_instance_if_value_is_equal() { var subject1 = new TcpStreamSettings(); var subject2 = subject1.WithReadTimeout(null); subject2.Should().BeSameAs(subject1); }
public void WithReceiveBufferSize_returns_same_instance_if_value_is_equal() { var subject1 = new TcpStreamSettings(); var subject2 = subject1.WithReceiveBufferSize(64 * 1024); subject2.Should().BeSameAs(subject1); }
public ClusterBuilder ConfigureTcp(Func <TcpStreamSettings, TcpStreamSettings> configure) { Ensure.IsNotNull(configure, "configure"); _tcpStreamSettings = configure(_tcpStreamSettings); return(this); }
// constructors public Builder(TcpStreamSettings other) { _addressFamily = other._addressFamily; _readTimeout = other._readTimeout; _receiveBufferSize = other._receiveBufferSize; _sendBufferSize = other._sendBufferSize; _writeTimeout = other._writeTimeout; }
// constructors public ClusterBuilder() { _clusterSettings = new ClusterSettings(); _serverSettings = new ServerSettings(); _connectionPoolSettings = new ConnectionPoolSettings(); _connectionSettings = new ConnectionSettings(); _tcpStreamSettings = new TcpStreamSettings(); _streamFactoryWrapper = inner => inner; }
public void Constructor_initializes_instance() { var subject = new TcpStreamSettings(); subject.AddressFamily.Should().Be(AddressFamily.InterNetwork); subject.ReadTimeout.Should().Be(null); subject.ReceiveBufferSize.Should().Be(64 * 1024); subject.SendBufferSize.Should().Be(64 * 1024); subject.WriteTimeout.Should().Be(null); }
// static constructor static ClusterKey() { var defaultServerSettings = new ServerSettings(); __defaultHeartbeatInterval = defaultServerSettings.HeartbeatInterval; __defaultHeartbeatTimeout = defaultServerSettings.HeartbeatTimeout; var defaultTcpStreamSettings = new TcpStreamSettings(); __defaultReceiveBufferSize = defaultTcpStreamSettings.ReceiveBufferSize; __defaultSendBufferSize = defaultTcpStreamSettings.SendBufferSize; }
public void WithReadTimeout_returns_new_instance_if_value_is_not_equal() { var oldSetting = (TimeSpan?)null; var newSetting = TimeSpan.FromMinutes(1); var subject1 = new TcpStreamSettings().WithReadTimeout(oldSetting); var subject2 = subject1.WithReadTimeout(newSetting); subject2.Should().NotBeSameAs(subject1); subject1.ReadTimeout.Should().Be(oldSetting); subject2.ReadTimeout.Should().Be(newSetting); }
public void WithAddressFamily_returns_new_instance_if_value_is_not_equal() { var oldSetting = AddressFamily.InterNetwork; var newSetting = AddressFamily.InterNetworkV6; var subject1 = new TcpStreamSettings().WithAddressFamily(oldSetting); var subject2 = subject1.WithAddressFamily(newSetting); subject2.Should().NotBeSameAs(subject1); subject1.AddressFamily.Should().Be(oldSetting); subject2.AddressFamily.Should().Be(newSetting); }
internal TcpStreamSettings(TcpStreamSettings other) { _addressFamily = other.AddressFamily; _connectTimeout = other.ConnectTimeout; _readTimeout = other.ReadTimeout; _receiveBufferSize = other.ReceiveBufferSize; _sendBufferSize = other.SendBufferSize; _socketConfigurator = other.SocketConfigurator; _writeTimeout = other.WriteTimeout; }
private IStreamFactory CreateTcpStreamFactory(TcpStreamSettings tcpStreamSettings) { var streamFactory = (IStreamFactory) new TcpStreamFactory(tcpStreamSettings); if (_sslStreamSettings != null) { streamFactory = new SslStreamFactory(_sslStreamSettings, streamFactory); } return(_streamFactoryWrapper(streamFactory)); }
public void WithReceiveBufferSize_returns_new_instance_if_value_is_not_equal() { var oldSetting = 10; var newSetting = 13; var subject1 = new TcpStreamSettings().WithReceiveBufferSize(oldSetting); var subject2 = subject1.WithReceiveBufferSize(newSetting); subject2.Should().NotBeSameAs(subject1); subject1.ReceiveBufferSize.Should().Be(oldSetting); subject2.ReceiveBufferSize.Should().Be(newSetting); }
// constructors /// <summary> /// Initializes a new instance of the <see cref="ClusterBuilder"/> class. /// </summary> public ClusterBuilder() { _clusterSettings = new ClusterSettings(); _sdamLoggingSettings = new SdamLoggingSettings(null); _serverSettings = new ServerSettings(); _connectionPoolSettings = new ConnectionPoolSettings(); _connectionSettings = new ConnectionSettings(); _tcpStreamSettings = new TcpStreamSettings(); _streamFactoryWrapper = inner => inner; _eventAggregator = new EventAggregator(); }
public async Task CreateStreamAsync_should_call_the_socketConfigurator() { var socketConfiguratorWasCalled = false; Action<Socket> socketConfigurator = s => socketConfiguratorWasCalled = true; var settings = new TcpStreamSettings(socketConfigurator: socketConfigurator); var subject = new TcpStreamFactory(settings); var endPoint = CoreTestConfiguration.ConnectionString.Hosts[0]; await subject.CreateStreamAsync(endPoint, CancellationToken.None); socketConfiguratorWasCalled.Should().BeTrue(); }
public void constructor_should_initialize_instance() { var subject = new TcpStreamSettings(); subject.AddressFamily.Should().Be(AddressFamily.InterNetwork); subject.ConnectTimeout.Should().Be(Timeout.InfiniteTimeSpan); subject.ReadTimeout.Should().Be(null); subject.ReceiveBufferSize.Should().Be(64 * 1024); subject.SendBufferSize.Should().Be(64 * 1024); subject.SocketConfigurator.Should().BeNull(); subject.WriteTimeout.Should().Be(null); }
public void constructor_with_writeTimeout_should_initialize_instance() { var writeTimeout = TimeSpan.FromSeconds(123); var subject = new TcpStreamSettings(writeTimeout: writeTimeout); subject.AddressFamily.Should().Be(__defaults.AddressFamily); subject.ConnectTimeout.Should().Be(subject.ConnectTimeout); subject.ReadTimeout.Should().Be(subject.ReadTimeout); subject.ReceiveBufferSize.Should().Be(__defaults.ReceiveBufferSize); subject.SendBufferSize.Should().Be(__defaults.SendBufferSize); subject.WriteTimeout.Should().Be(writeTimeout); }
public void constructor_with_sendBufferSize_should_initialize_instance() { var sendBufferSize = 123; var subject = new TcpStreamSettings(sendBufferSize: sendBufferSize); subject.AddressFamily.Should().Be(__defaults.AddressFamily); subject.ConnectTimeout.Should().Be(subject.ConnectTimeout); subject.ReadTimeout.Should().Be(subject.ReadTimeout); subject.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); subject.SendBufferSize.Should().Be(sendBufferSize); subject.WriteTimeout.Should().Be(__defaults.WriteTimeout); }
public void constructor_with_addressFamily_should_initialize_instance() { var addressFamily = AddressFamily.InterNetworkV6; var subject = new TcpStreamSettings(addressFamily: addressFamily); subject.AddressFamily.Should().Be(addressFamily); subject.ConnectTimeout.Should().Be(__defaults.ConnectTimeout); subject.ReadTimeout.Should().Be(__defaults.ReadTimeout); subject.ReceiveBufferSize.Should().Be(__defaults.ReceiveBufferSize); subject.SendBufferSize.Should().Be(__defaults.SendBufferSize); subject.WriteTimeout.Should().Be(__defaults.WriteTimeout); }
public void constructor_with_socketConfigurator_should_initialize_instance() { Action <Socket> socketConfigurator = s => { }; var subject = new TcpStreamSettings(socketConfigurator: socketConfigurator); subject.AddressFamily.Should().Be(__defaults.AddressFamily); subject.ConnectTimeout.Should().Be(subject.ConnectTimeout); subject.ReadTimeout.Should().Be(subject.ReadTimeout); subject.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); subject.SendBufferSize.Should().Be(subject.SendBufferSize); subject.SocketConfigurator.Should().Be(socketConfigurator); subject.WriteTimeout.Should().Be(__defaults.WriteTimeout); }
public async Task SocketConfigurator_can_be_used_to_set_keepAlive() { Action<Socket> socketConfigurator = s => s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true); var settings = new TcpStreamSettings(socketConfigurator: socketConfigurator); var subject = new TcpStreamFactory(settings); var endPoint = CoreTestConfiguration.ConnectionString.Hosts[0]; var stream = await subject.CreateStreamAsync(endPoint, CancellationToken.None); var socketProperty = typeof(NetworkStream).GetProperty("Socket", BindingFlags.NonPublic | BindingFlags.Instance); var socket = (Socket)socketProperty.GetValue(stream); var keepAlive = (int)socket.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive); keepAlive.Should().NotBe(0); // .NET returns 1 but Mono returns 8 }
public void With_addressFamily_should_return_expected_result() { var oldAddressFamily = AddressFamily.InterNetwork; var newAddressFamily = AddressFamily.InterNetworkV6; var subject = new TcpStreamSettings(addressFamily: oldAddressFamily); var result = subject.With(addressFamily: newAddressFamily); result.AddressFamily.Should().Be(newAddressFamily); result.ConnectTimeout.Should().Be(subject.ConnectTimeout); result.ReadTimeout.Should().Be(subject.ReadTimeout); result.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); result.SendBufferSize.Should().Be(subject.SendBufferSize); result.WriteTimeout.Should().Be(subject.WriteTimeout); }
public void With_sendBufferSize_should_return_expected_result() { var oldSendBufferSize = 1; var newSendBufferSize = 2; var subject = new TcpStreamSettings(sendBufferSize: oldSendBufferSize); var result = subject.With(sendBufferSize: newSendBufferSize); result.AddressFamily.Should().Be(subject.AddressFamily); result.ConnectTimeout.Should().Be(subject.ConnectTimeout); result.ReadTimeout.Should().Be(subject.ReadTimeout); result.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); result.SendBufferSize.Should().Be(newSendBufferSize); result.WriteTimeout.Should().Be(subject.WriteTimeout); }
public void With_writeTimeout_should_return_expected_result() { var oldWriteTimeout = TimeSpan.FromSeconds(1); var newWriteTimeout = TimeSpan.FromSeconds(2); var subject = new TcpStreamSettings(writeTimeout: oldWriteTimeout); var result = subject.With(writeTimeout: newWriteTimeout); result.AddressFamily.Should().Be(subject.AddressFamily); result.ConnectTimeout.Should().Be(subject.ConnectTimeout); result.ReadTimeout.Should().Be(subject.ReadTimeout); result.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); result.SendBufferSize.Should().Be(subject.SendBufferSize); result.WriteTimeout.Should().Be(newWriteTimeout); }
public void With_socketConfigurator_should_return_expected_result() { Action <Socket> oldSocketConfigurator = null; Action <Socket> newSocketConfigurator = s => { }; var subject = new TcpStreamSettings(socketConfigurator: oldSocketConfigurator); var result = subject.With(socketConfigurator: newSocketConfigurator); result.AddressFamily.Should().Be(subject.AddressFamily); result.ConnectTimeout.Should().Be(subject.ConnectTimeout); result.ReadTimeout.Should().Be(subject.ReadTimeout); result.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); result.SendBufferSize.Should().Be(subject.SendBufferSize); result.SocketConfigurator.Should().Be(newSocketConfigurator); result.WriteTimeout.Should().Be(subject.WriteTimeout); }
private IServerMonitorFactory CreateServerMonitorFactory() { var serverMonitorConnectionSettings = _connectionSettings .With(authenticatorFactories: new IAuthenticatorFactory[] { }); var heartbeatConnectTimeout = _tcpStreamSettings.ConnectTimeout; if (heartbeatConnectTimeout == TimeSpan.Zero || heartbeatConnectTimeout == Timeout.InfiniteTimeSpan) { heartbeatConnectTimeout = TimeSpan.FromSeconds(30); } var heartbeatSocketTimeout = _serverSettings.HeartbeatTimeout; if (heartbeatSocketTimeout == TimeSpan.Zero || heartbeatSocketTimeout == Timeout.InfiniteTimeSpan) { heartbeatSocketTimeout = heartbeatConnectTimeout; } var serverMonitorTcpStreamSettings = new TcpStreamSettings(_tcpStreamSettings) .With( connectTimeout: heartbeatConnectTimeout, readTimeout: heartbeatSocketTimeout, writeTimeout: heartbeatSocketTimeout ); var serverMonitorStreamFactory = CreateTcpStreamFactory(serverMonitorTcpStreamSettings); var serverMonitorSettings = new ServerMonitorSettings( connectTimeout: serverMonitorTcpStreamSettings.ConnectTimeout, heartbeatInterval: _serverSettings.HeartbeatInterval); var serverMonitorConnectionFactory = new BinaryConnectionFactory( serverMonitorConnectionSettings, serverMonitorStreamFactory, new EventAggregator(), _clusterSettings.ServerApi); return(new ServerMonitorFactory( serverMonitorSettings, serverMonitorConnectionFactory, _eventAggregator, _clusterSettings.ServerApi)); }
public void constructor_with_other_should_initialize_instance() { var other = new TcpStreamSettings( addressFamily: AddressFamily.InterNetworkV6, connectTimeout: TimeSpan.FromSeconds(123), readTimeout: TimeSpan.FromSeconds(456), receiveBufferSize: 123, sendBufferSize: 456, socketConfigurator: (Action <Socket>)((Socket _) => { }), writeTimeout: TimeSpan.FromSeconds(789) ); var result = new TcpStreamSettings(other); result.AddressFamily.Should().Be(other.AddressFamily); result.ConnectTimeout.Should().Be(other.ConnectTimeout); result.ReadTimeout.Should().Be(other.ReadTimeout); result.ReceiveBufferSize.Should().Be(other.ReceiveBufferSize); result.SendBufferSize.Should().Be(other.SendBufferSize); result.SocketConfigurator.Should().Be(other.SocketConfigurator); result.WriteTimeout.Should().Be(other.WriteTimeout); }
private TcpStreamSettings ConfigureTcp(TcpStreamSettings settings, ClusterKey clusterKey) { return settings.With( connectTimeout: clusterKey.ConnectTimeout, readTimeout: clusterKey.SocketTimeout, receiveBufferSize: clusterKey.ReceiveBufferSize, sendBufferSize: clusterKey.SendBufferSize, writeTimeout: clusterKey.SocketTimeout); }
public TcpStreamFactory(TcpStreamSettings settings) { _settings = Ensure.IsNotNull(settings, nameof(settings)); }
public void constructor_with_socketConfigurator_should_initialize_instance() { Action<Socket> socketConfigurator = s => { }; var subject = new TcpStreamSettings(socketConfigurator: socketConfigurator); subject.AddressFamily.Should().Be(__defaults.AddressFamily); subject.ConnectTimeout.Should().Be(subject.ConnectTimeout); subject.ReadTimeout.Should().Be(subject.ReadTimeout); subject.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); subject.SendBufferSize.Should().Be(subject.SendBufferSize); subject.SocketConfigurator.Should().Be(socketConfigurator); subject.WriteTimeout.Should().Be(__defaults.WriteTimeout); }
// static constructor static ClusterKey() { var defaultTcpStreamSettings = new TcpStreamSettings(); __defaultReceiveBufferSize = defaultTcpStreamSettings.ReceiveBufferSize; __defaultSendBufferSize = defaultTcpStreamSettings.SendBufferSize; }
public void SocketConfigurator_can_be_used_to_set_keepAlive( [Values(false, true)] bool async) { RequireServer.Any(); Action<Socket> socketConfigurator = s => s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true); var settings = new TcpStreamSettings(socketConfigurator: socketConfigurator); var subject = new TcpStreamFactory(settings); var endPoint = CoreTestConfiguration.ConnectionString.Hosts[0]; Stream stream; if (async) { stream = subject.CreateStreamAsync(endPoint, CancellationToken.None).GetAwaiter().GetResult(); } else { stream = subject.CreateStream(endPoint, CancellationToken.None); } var socketProperty = typeof(NetworkStream).GetProperty("Socket", BindingFlags.NonPublic | BindingFlags.Instance); var socket = (Socket)socketProperty.GetValue(stream); var keepAlive = (int)socket.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive); keepAlive.Should().NotBe(0); // .NET returns 1 but Mono returns 8 }
public void constructor_with_addressFamily_should_initialize_instance() { var addressFamily = AddressFamily.InterNetworkV6; var subject = new TcpStreamSettings(addressFamily: addressFamily); subject.AddressFamily.Should().Be(addressFamily); subject.ConnectTimeout.Should().Be(__defaults.ConnectTimeout); subject.ReadTimeout.Should().Be(__defaults.ReadTimeout); subject.ReceiveBufferSize.Should().Be(__defaults.ReceiveBufferSize); subject.SendBufferSize.Should().Be(__defaults.SendBufferSize); subject.SocketConfigurator.Should().Be(__defaults.SocketConfigurator); subject.WriteTimeout.Should().Be(__defaults.WriteTimeout); }
public void With_writeTimeout_should_return_expected_result() { var oldWriteTimeout = TimeSpan.FromSeconds(1); var newWriteTimeout = TimeSpan.FromSeconds(2); var subject = new TcpStreamSettings(writeTimeout: oldWriteTimeout); var result = subject.With(writeTimeout: newWriteTimeout); result.AddressFamily.Should().Be(subject.AddressFamily); result.ConnectTimeout.Should().Be(subject.ConnectTimeout); result.ReadTimeout.Should().Be(subject.ReadTimeout); result.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); result.SendBufferSize.Should().Be(subject.SendBufferSize); result.SocketConfigurator.Should().Be(subject.SocketConfigurator); result.WriteTimeout.Should().Be(newWriteTimeout); }
public void With_socketConfigurator_should_return_expected_result() { Action<Socket> oldSocketConfigurator = null; Action<Socket> newSocketConfigurator = s => { }; var subject = new TcpStreamSettings(socketConfigurator: oldSocketConfigurator); var result = subject.With(socketConfigurator: newSocketConfigurator); result.AddressFamily.Should().Be(subject.AddressFamily); result.ConnectTimeout.Should().Be(subject.ConnectTimeout); result.ReadTimeout.Should().Be(subject.ReadTimeout); result.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); result.SendBufferSize.Should().Be(subject.SendBufferSize); result.SocketConfigurator.Should().Be(newSocketConfigurator); result.WriteTimeout.Should().Be(subject.WriteTimeout); }
public void With_sendBufferSize_should_return_expected_result() { var oldSendBufferSize = 1; var newSendBufferSize = 2; var subject = new TcpStreamSettings(sendBufferSize: oldSendBufferSize); var result = subject.With(sendBufferSize: newSendBufferSize); result.AddressFamily.Should().Be(subject.AddressFamily); result.ConnectTimeout.Should().Be(subject.ConnectTimeout); result.ReadTimeout.Should().Be(subject.ReadTimeout); result.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); result.SendBufferSize.Should().Be(newSendBufferSize); result.SocketConfigurator.Should().Be(subject.SocketConfigurator); result.WriteTimeout.Should().Be(subject.WriteTimeout); }
public void With_addressFamily_should_return_expected_result() { var oldAddressFamily = AddressFamily.InterNetwork; var newAddressFamily = AddressFamily.InterNetworkV6; var subject = new TcpStreamSettings(addressFamily: oldAddressFamily); var result = subject.With(addressFamily: newAddressFamily); result.AddressFamily.Should().Be(newAddressFamily); result.ConnectTimeout.Should().Be(subject.ConnectTimeout); result.ReadTimeout.Should().Be(subject.ReadTimeout); result.ReceiveBufferSize.Should().Be(subject.ReceiveBufferSize); result.SendBufferSize.Should().Be(subject.SendBufferSize); result.SocketConfigurator.Should().Be(subject.SocketConfigurator); result.WriteTimeout.Should().Be(subject.WriteTimeout); }
public void constructor_with_writeTimeout_should_initialize_instance() { var writeTimeout = TimeSpan.FromSeconds(123); var subject = new TcpStreamSettings(writeTimeout: writeTimeout); subject.AddressFamily.Should().Be(__defaults.AddressFamily); subject.ConnectTimeout.Should().Be(subject.ConnectTimeout); subject.ReadTimeout.Should().Be(subject.ReadTimeout); subject.ReceiveBufferSize.Should().Be(__defaults.ReceiveBufferSize); subject.SendBufferSize.Should().Be(__defaults.SendBufferSize); subject.SocketConfigurator.Should().Be(__defaults.SocketConfigurator); subject.WriteTimeout.Should().Be(writeTimeout); }
public void CreateStream_should_call_the_socketConfigurator( [Values(false, true)] bool async) { RequireServer.Any(); var socketConfiguratorWasCalled = false; Action<Socket> socketConfigurator = s => socketConfiguratorWasCalled = true; var settings = new TcpStreamSettings(socketConfigurator: socketConfigurator); var subject = new TcpStreamFactory(settings); var endPoint = CoreTestConfiguration.ConnectionString.Hosts[0]; if (async) { subject.CreateStreamAsync(endPoint, CancellationToken.None).GetAwaiter().GetResult(); } else { subject.CreateStream(endPoint, CancellationToken.None); } socketConfiguratorWasCalled.Should().BeTrue(); }
public void CreateStream_should_throw_when_connect_timeout_has_expired( [Values(false, true)] bool async) { var settings = new TcpStreamSettings(connectTimeout: TimeSpan.FromMilliseconds(20)); var subject = new TcpStreamFactory(settings); var endPoint = new IPEndPoint(new IPAddress(0x01010101), 12345); // a non-existent host and port Action action; if (async) { action = () => subject.CreateStreamAsync(endPoint, CancellationToken.None).GetAwaiter().GetResult(); ; } else { action = () => subject.CreateStream(endPoint, CancellationToken.None); } action.ShouldThrow<TimeoutException>(); }
// constructors public TcpStreamFactory() { _settings = new TcpStreamSettings(); }
private TcpStreamSettings ConfigureTcp(TcpStreamSettings settings, ClusterKey clusterKey) { if (clusterKey.IPv6) { settings = settings.With(addressFamily: AddressFamily.InterNetworkV6); } return settings.With( connectTimeout: clusterKey.ConnectTimeout, readTimeout: clusterKey.SocketTimeout, receiveBufferSize: clusterKey.ReceiveBufferSize, sendBufferSize: clusterKey.SendBufferSize, writeTimeout: clusterKey.SocketTimeout); }
public TcpStreamFactory(TcpStreamSettings settings) { _settings = Ensure.IsNotNull(settings, "settings"); }
public ClusterBuilder ConfigureTcp(Func<TcpStreamSettings, TcpStreamSettings> configure) { Ensure.IsNotNull(configure, "configure"); _tcpStreamSettings = configure(_tcpStreamSettings); return this; }
public void constructor_with_receiveBufferSize_should_initialize_instance() { var receiveBufferSize = 123; var subject = new TcpStreamSettings(receiveBufferSize: receiveBufferSize); subject.AddressFamily.Should().Be(__defaults.AddressFamily); subject.ConnectTimeout.Should().Be(subject.ConnectTimeout); subject.ReadTimeout.Should().Be(subject.ReadTimeout); subject.ReceiveBufferSize.Should().Be(receiveBufferSize); subject.SendBufferSize.Should().Be(__defaults.SendBufferSize); subject.SocketConfigurator.Should().Be(__defaults.SocketConfigurator); subject.WriteTimeout.Should().Be(__defaults.WriteTimeout); }