Delegate ConnectionTransportFactory
Produces the connected, plain (not encrypted) duplex stream a connection will run on, in place of the socket the library would otherwise open itself.
This is the seam for reaching a broker that is not directly dialable - most commonly a socket
tunnelled through an HTTP CONNECT proxy. TLS is not the factory's job: when the scheme
is amqps the library negotiates TLS over the returned stream using
TlsSettings, and validates the broker certificate against
Host. The certificate is therefore checked against the
broker's real name, not against the address the factory had to dial.
The factory is invoked once per connection attempt, including every recovery attempt, so it must return a freshly connected stream each time. Ownership of the stream passes to the connection, which disposes it when the connection closes.
public delegate Task<Stream> ConnectionTransportFactory(string host, int port, CancellationToken cancellationToken)
Parameters
hoststringThe broker host from the connection settings, unresolved.
portintThe broker port from the connection settings.
cancellationTokenCancellationTokenToken to cancel establishing the transport.