Skip to content

Allow customizing Socket.AcceptAsync() call #34344

Closed
@kevin-montrose

Description

@kevin-montrose

We have an application where it would useful to be able to inspect a Socket after it is accepted, but before any other operations happen on it, in order to determine whether we want to marshal it over to another process to handle.

Currently this is not possible because once accepted in SocketConnectionListener, a Socket is almost immediately wrapped up in a ConnectionContext and read from.

It is important for us to inspect a Socket immediately, as (on Windows) once asynchronous I/O beings moving a Socket to another process will fail (see DuplicateAndClose).

Describe the solution you'd like

Ideally a new option is added to SocketTransportOptions which, similar to CreateBoundListenSocket, allows customizing this Socket-y operation. I'll have a PR sketching this out up shortly. #34345

Metadata

Metadata

Assignees

Labels

area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-kestrel

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions