Skip to content

Add IConnectionFactory implementation to the socket transport #15019

Closed
@davidfowl

Description

@davidfowl

Today we have all of the pieces in place the server transport but we haven't exposed anything to do client sockets. There's an internal version of the API we want here so we can start with that as the initial API:

public class SocketConnectionFactory : IConnectionFactory, IAsyncDisposable
{
    public SocketConnectionFactory(IOptions<SocketTransportOptions> options, ILoggerFactory loggerFactory);
    public async ValueTask<ConnectionContext> ConnectAsync(EndPoint endpoint, CancellationToken cancellationToken = default);
}

PS: This will fully enable

Some observations/questions:

  • The SocketConnectionFactory is IAsyncDisposable because it owns the memory pool. Do we want all connections made by the same factory sharing the pool? If yes then this type should maybe track outstanding connections before disposing the factory.
  • As part of these refactorings, we should have a way to construct these types without passing Options.Create(OptionsType).
  • Are there any client options that are different from server options? This spike had a shared options base class, and also had client and server options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions🥌 Bedrock

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions