Skip to content

Commit 6f4b119

Browse files
rstamvincentkam
authored andcommitted
CSHARP-3117: Fix timeout connecting to server on Linux
1 parent b9b4d66 commit 6f4b119

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/MongoDB.Driver.Core/Core/Connections/TcpStreamFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public TcpStreamFactory(TcpStreamSettings settings)
4848
// methods
4949
public Stream CreateStream(EndPoint endPoint, CancellationToken cancellationToken)
5050
{
51-
#if NETSTANDARD1_5
51+
#if NETSTANDARD1_5 || NETSTANDARD2_0
5252
// ugh... I know... but there isn't a non-async version of dns resolution
5353
// in .NET Core
5454
var resolved = ResolveEndPointsAsync(endPoint).GetAwaiter().GetResult();
@@ -82,7 +82,7 @@ public Stream CreateStream(EndPoint endPoint, CancellationToken cancellationToke
8282

8383
public async Task<Stream> CreateStreamAsync(EndPoint endPoint, CancellationToken cancellationToken)
8484
{
85-
#if NETSTANDARD1_5
85+
#if NETSTANDARD1_5 || NETSTANDARD2_0
8686
var resolved = await ResolveEndPointsAsync(endPoint).ConfigureAwait(false);
8787
for (int i = 0; i < resolved.Length; i++)
8888
{
@@ -181,7 +181,7 @@ private async Task ConnectAsync(Socket socket, EndPoint endPoint, CancellationTo
181181
try
182182
{
183183
var dnsEndPoint = endPoint as DnsEndPoint;
184-
#if NETSTANDARD1_5
184+
#if NETSTANDARD1_5 || NETSTANDARD2_0
185185
await socket.ConnectAsync(endPoint).ConfigureAwait(false);
186186
#else
187187
if (dnsEndPoint != null)

0 commit comments

Comments
 (0)