Skip to content

Add method to create ConnectionContext from Socket #34522

@shirhatti

Description

@shirhatti

As part of the scenario described by @kevin-montrose in #34344, we'd like for the sockets transport to create a connection context from an already accepted socket. In Kevin's example, the socket is accepted in another process before being marshalled over an IPC mechanism.

namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets
{
    public class SocketTransportFactory
    {
       public static ConnectionContext CreateConnectionContextFromSocket(Socket socket, SocketTransportOptions options);
    }
}

The consumer of this API will implement a custom IConnectionListenerFactory and will call this new static method in their IConnectionListener.AcceptAsync implementation

Metadata

Metadata

Assignees

Labels

✔️ Resolution: FixedThe bug or enhancement requested in this issue has been checked-in!DoneThis issue has been fixedapi-approvedAPI was approved in API review, it can be implementedarea-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