Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit c5da62c

Browse files
committed
Use extensions for Stream and Sockets
1 parent c8aabf8 commit c5da62c

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

src/ServiceStack.Redis/RedisNativeClient.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,31 +2455,19 @@ private void SafeConnectionClose()
24552455
{
24562456
// workaround for a .net bug: http://support.microsoft.com/kb/821625
24572457
if (Bstream != null)
2458-
#if NETSTANDARD1_3
2459-
Bstream.Dispose();
2460-
#else
24612458
Bstream.Close();
2462-
#endif
24632459
}
24642460
catch { }
24652461
try
24662462
{
24672463
if (sslStream != null)
2468-
#if NETSTANDARD1_3
2469-
sslStream.Dispose();
2470-
#else
24712464
sslStream.Close();
2472-
#endif
24732465
}
24742466
catch { }
24752467
try
24762468
{
24772469
if (socket != null)
2478-
#if NETSTANDARD1_3
2479-
socket.Dispose();
2480-
#else
24812470
socket.Close();
2482-
#endif
24832471
}
24842472
catch { }
24852473

src/ServiceStack.Redis/RedisNativeClient_Utils.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,7 @@ private void Connect()
100100

101101
if (!socket.Connected)
102102
{
103-
#if NETSTANDARD1_3
104-
socket.Dispose();
105-
#else
106103
socket.Close();
107-
#endif
108104
socket = null;
109105
DeactivatedAt = DateTime.UtcNow;
110106
return;
@@ -261,11 +257,7 @@ internal bool AssertConnectedSocket()
261257
log.Error(ErrorConnect.Fmt(Host, Port));
262258

263259
if (socket != null)
264-
#if NETSTANDARD1_3
265-
socket.Dispose();
266-
#else
267260
socket.Close();
268-
#endif
269261

270262
socket = null;
271263

@@ -633,11 +625,7 @@ private Exception GetRetryableException(Exception outerEx)
633625
lastSocketException = socketEx;
634626

635627
if (socket != null)
636-
#if NETSTANDARD1_3
637-
socket.Dispose();
638-
#else
639628
socket.Close();
640-
#endif
641629

642630
socket = null;
643631
return socketEx;

0 commit comments

Comments
 (0)