Skip to content

Commit 83e8b52

Browse files
committed
pr
1 parent 6b9eb50 commit 83e8b52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ static void DisposeSocket(Socket socket)
226226
static void EnsureConnected(Socket socket)
227227
{
228228
bool originalBlockingState = socket.Blocking;
229-
socket.Blocking = false;
230229

231230
try
232231
{
232+
socket.Blocking = false;
233233
// Try to use the socket to ensure it's connected. On MacOS with net6.0 sometimes Connect is completed successfully even after the socket disposal.
234234
socket.Send(__ensureConnectedBuffer, 0, 0);
235235
}

0 commit comments

Comments
 (0)