From a93fcbb89c1be393d8ead46e52129c68d0bbabff Mon Sep 17 00:00:00 2001 From: Vasiliy Novikov Date: Fri, 8 Jun 2018 08:55:28 +0000 Subject: [PATCH 1/5] Added support for UnixDomainSocketEndPoint introduced in .NET Core 2.1 --- StackExchange.Redis/StackExchange/Redis/SocketManager.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/StackExchange.Redis/StackExchange/Redis/SocketManager.cs b/StackExchange.Redis/StackExchange/Redis/SocketManager.cs index 576f7e848..0c2ae392e 100644 --- a/StackExchange.Redis/StackExchange/Redis/SocketManager.cs +++ b/StackExchange.Redis/StackExchange/Redis/SocketManager.cs @@ -190,9 +190,13 @@ void proxyCallback(IAsyncResult ar) } var addressFamily = endpoint.AddressFamily == AddressFamily.Unspecified ? AddressFamily.InterNetwork : endpoint.AddressFamily; - var socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp); + var protocolType = addressFamily == AddressFamily.Unix ? ProtocolType.Unspecified : ProtocolType.Tcp; + var socket = new Socket(addressFamily, SocketType.Stream, protocolType); SetFastLoopbackOption(socket); - socket.NoDelay = true; + if (addressFamily != AddressFamily.Unix) + { + socket.NoDelay = true; + } try { var formattedEndpoint = Format.ToString(endpoint); From 64a4a523eb7943b6ce70e41f743f81691b913e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=BC=9F?= Date: Tue, 26 Jun 2018 13:03:23 +0800 Subject: [PATCH 2/5] remove package System.IO.Compression --- .../StackExchange.Redis.StrongName.csproj | 6 +----- StackExchange.Redis/StackExchange.Redis.csproj | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/StackExchange.Redis.StrongName/StackExchange.Redis.StrongName.csproj b/StackExchange.Redis.StrongName/StackExchange.Redis.StrongName.csproj index 6437b78f7..0d1071424 100644 --- a/StackExchange.Redis.StrongName/StackExchange.Redis.StrongName.csproj +++ b/StackExchange.Redis.StrongName/StackExchange.Redis.StrongName.csproj @@ -16,18 +16,14 @@ - + $(DefineConstants);FEATURE_SOCKET_MODE_POLL;FEATURE_PERFCOUNTER; - - - - diff --git a/StackExchange.Redis/StackExchange.Redis.csproj b/StackExchange.Redis/StackExchange.Redis.csproj index 5b00550e7..780489ef9 100644 --- a/StackExchange.Redis/StackExchange.Redis.csproj +++ b/StackExchange.Redis/StackExchange.Redis.csproj @@ -11,18 +11,14 @@ - + $(DefineConstants);FEATURE_SOCKET_MODE_POLL;FEATURE_PERFCOUNTER; - - - - From 18c607d463a259271f34dfc3b3d21a334943c742 Mon Sep 17 00:00:00 2001 From: Nick Craver Date: Wed, 27 Jun 2018 21:26:04 -0400 Subject: [PATCH 3/5] Add linux start script for tests Useful for WSL testing Streams --- RedisConfigs/start-all.sh | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 RedisConfigs/start-all.sh diff --git a/RedisConfigs/start-all.sh b/RedisConfigs/start-all.sh new file mode 100644 index 000000000..3b5676e02 --- /dev/null +++ b/RedisConfigs/start-all.sh @@ -0,0 +1,45 @@ +echo Starting Redis servers for testing... + +#Basic Servers +echo Starting Basic: 6379-6382 +pushd Basic > /dev/null +echo Master: 6379 +redis-server master-6379.conf &>/dev/null & +echo Slave: 6380 +redis-server slave-6380.conf &>/dev/null & +echo Secure: 6381 +redis-server secure-6381.conf &>/dev/null & +popd > /dev/null + +#Failover Servers +echo Starting Failover: 6382-6383 +pushd Failover > /dev/null +echo Master: 6382 +redis-server master-6382.conf &>/dev/null & +echo Slave: 6383 +redis-server slave-6383.conf &>/dev/null & +popd > /dev/null + +# Cluster Servers +echo Starting Cluster: 7000-7005 +pushd Cluster > /dev/null +redis-server cluster-7000.conf &>/dev/null & +redis-server cluster-7001.conf &>/dev/null & +redis-server cluster-7002.conf &>/dev/null & +redis-server cluster-7003.conf &>/dev/null & +redis-server cluster-7004.conf &>/dev/null & +redis-server cluster-7005.conf &>/dev/null & +popd > /dev/null + +#Sentinel Servers +echo Starting Sentinel: 7010-7011,26379-26380 +pushd Sentinel > /dev/null +echo Targets: 7010-7011 +redis-server redis-7010.conf &>/dev/null & +redis-server redis-7011.conf &>/dev/null & +echo Monitors: 26379-26380 +redis-server sentinel-26379.conf --sentinel &>/dev/null & +redis-server sentinel-26380.conf --sentinel &>/dev/null & +popd > /dev/null + +echo Servers started. \ No newline at end of file From 9bb2665b85c2f5bb592917e3eeb83380ba630a01 Mon Sep 17 00:00:00 2001 From: Nick Craver Date: Thu, 28 Jun 2018 18:41:55 -0400 Subject: [PATCH 4/5] Deprecate WriteBuffer Being removed in v2.0 --- .../StackExchange/Redis/ConfigurationOptions.cs | 3 +++ StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs b/StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs index e4ac34d0d..2f7887824 100644 --- a/StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs +++ b/StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs @@ -321,6 +321,7 @@ public int ConnectTimeout /// /// The size of the output buffer to use /// + [Obsolete("WriteBuffer will be removed in the 2.0 release - see https://github.com/StackExchange/StackExchange.Redis/issues/871 for details.", false)] public int WriteBuffer { get { return writeBuffer.GetValueOrDefault(4096); } set { writeBuffer = value; } } internal LocalCertificateSelectionCallback CertificateSelectionCallback { get { return CertificateSelection; } private set { CertificateSelection = value; } } @@ -631,7 +632,9 @@ private void DoParse(string configuration, bool ignoreUnknown) HighPrioritySocketThreads = OptionKeys.ParseBoolean(key, value); break; case OptionKeys.WriteBuffer: +#pragma warning disable CS0618 // Type or member is obsolete WriteBuffer = OptionKeys.ParseInt32(key, value); +#pragma warning restore CS0618 // Type or member is obsolete break; case OptionKeys.Proxy: Proxy = OptionKeys.ParseProxy(key, value); diff --git a/StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs b/StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs index 8ed3ac367..6c317c6dc 100644 --- a/StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs +++ b/StackExchange.Redis/StackExchange/Redis/PhysicalConnection.cs @@ -759,7 +759,9 @@ SocketMode ISocketCallback.Connected(Stream stream, TextWriter log) } OnWrapForLogging(ref stream, physicalName); +#pragma warning disable CS0618 // Type or member is obsolete int bufferSize = config.WriteBuffer; +#pragma warning restore CS0618 // Type or member is obsolete netStream = stream; outStream = bufferSize <= 0 ? stream : new BufferedStream(stream, bufferSize); Multiplexer.LogLocked(log, "Connected {0}", Bridge); From 1799c39d7287f179d8c824fb76f53e27be8c5cf7 Mon Sep 17 00:00:00 2001 From: Marc Gravell Date: Fri, 29 Jun 2018 13:44:58 +0100 Subject: [PATCH 5/5] moving WriteBuffer obsolete msg to 2.0 --- StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs b/StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs index 2f7887824..dfa46b25d 100644 --- a/StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs +++ b/StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs @@ -321,7 +321,6 @@ public int ConnectTimeout /// /// The size of the output buffer to use /// - [Obsolete("WriteBuffer will be removed in the 2.0 release - see https://github.com/StackExchange/StackExchange.Redis/issues/871 for details.", false)] public int WriteBuffer { get { return writeBuffer.GetValueOrDefault(4096); } set { writeBuffer = value; } } internal LocalCertificateSelectionCallback CertificateSelectionCallback { get { return CertificateSelection; } private set { CertificateSelection = value; } }