connectionFactory method
Future<ConnectionTask<Socket> >
connectionFactory(
- dynamic uri,
- String? proxyHost,
- int? proxyPort,
- SecurityContext? context,
Custom connection factory for creating socket connections.
Resolves and connects to the specified uri
.
Optionally supports proxies and secure connections.
Returns a Future that completes with a ConnectionTask for a Socket.
Implementation
Future<ConnectionTask<Socket>> connectionFactory(
uri, String? proxyHost, int? proxyPort, SecurityContext? context) {
var socketAsync = _socketConnector.openSocket(
uri.host,
uri.port,
secure: uri.scheme == 'https',
context: context,
);
return Future.value(ConnectionTask.fromSocket(socketAsync, () {}));
}