Skip to content

Commit fe9ff1f

Browse files
alkampfergitrstam
authored andcommitted
CSHARP-2067: TcpStreamFactory.ConnectAsync should use Socket.ConnectAsync
1 parent 0ff5b05 commit fe9ff1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private async Task ConnectAsync(Socket socket, EndPoint endPoint, CancellationTo
179179
{
180180
var dnsEndPoint = endPoint as DnsEndPoint;
181181
#if NETSTANDARD1_5 || NETSTANDARD1_6
182-
await Task.Run(() => socket.Connect(endPoint)); // TODO: honor cancellationToken
182+
await socket.ConnectAsync(endPoint).ConfigureAwait(false); // TODO: honor cancellationToken
183183
#else
184184
if (dnsEndPoint != null)
185185
{

0 commit comments

Comments
 (0)