From 5dd0b87f0c12efb1d9c41422befdfc6b272ab6d8 Mon Sep 17 00:00:00 2001 From: LincolnYang1 Date: Wed, 20 Oct 2021 16:45:08 +0800 Subject: [PATCH] Preventing caching IP endpoint for supporting database failover --- .../Internal/InternalConnectionFactory.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/AdoNetCore.AseClient/Internal/InternalConnectionFactory.cs b/src/AdoNetCore.AseClient/Internal/InternalConnectionFactory.cs index 2c4bf8d..aa291b1 100644 --- a/src/AdoNetCore.AseClient/Internal/InternalConnectionFactory.cs +++ b/src/AdoNetCore.AseClient/Internal/InternalConnectionFactory.cs @@ -73,10 +73,7 @@ private Socket CreateSocket(CancellationToken token) { try { - if (_endpoint == null) - { - _endpoint = CreateEndpoint(_parameters.Server, _parameters.Port, token); - } + _endpoint = CreateEndpoint(_parameters.Server, _parameters.Port, token); return new Socket(_endpoint.AddressFamily, SocketType.Stream, ProtocolType.IP); }