When socket.ConnectAsync() throws an error synchronously, SocketAsyncEventArgs is not disposed

Description

Related to CSHARP-691, in the case when socket.ConnectAsync(e) throws an error synchronously the driver is not disposing the event args.

In that case, the resources are not going to be freed until the finalizer is called.

Note that as the driver properly configures the socket, ConnectAsync() will complete asynchronously in most cases (IO pending), even if there is no process listening on the remote port or the address can't be reached. I could reproduce sync completion of ConnectAsync() only when connecting to a port that is listening on a local interface w/ Linux under .NET Core 2.0+.

Environment

None

Activity

Show:

Joao Reis 
February 13, 2020 at 6:44 PM

Flag removed

merged to dse

Joao Reis 
February 11, 2020 at 7:02 PM

Flag added

merged to OSS

Fixed

Details

Assignee

Reporter

Fix versions

Sprint

Affects versions

Priority

Created June 19, 2018 at 7:28 AM
Updated March 24, 2020 at 7:24 PM
Resolved March 24, 2020 at 7:24 PM