Class ConnectionFactory
The factory to create connections asynchronously.
Implements
Inherited Members
Namespace: Amqp
Assembly: Amqp.Net.dll
Syntax
public class ConnectionFactory : ConnectionFactoryBase, IConnectionFactory
Constructors
ConnectionFactory()
Constructor to create a connection factory with default transport implementations.
Declaration
public ConnectionFactory()
ConnectionFactory(IEnumerable<TransportProvider>)
Creates a connection factory with a custom transport factory.
Declaration
public ConnectionFactory(IEnumerable<TransportProvider> providers)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TransportProvider> | providers | The custom transport providers. |
Remarks
The library provides built-in transport implementation for address schemes "amqp", "amqps" (and "ws", "wss" on .Net framework). Application can replace or extend it with custom implementations. When the built-in provider is replaced, the TCP and SSL settings of the connection factory will not be applied to the custom implementation.
Properties
SASL
Gets the SASL settings on the factory.
Declaration
public ConnectionFactory.SaslSettings SASL { get; }
Property Value
Type | Description |
---|---|
ConnectionFactory.SaslSettings |
SSL
Gets the TLS/SSL settings on the factory.
Declaration
public ConnectionFactory.SslSettings SSL { get; }
Property Value
Type | Description |
---|---|
ConnectionFactory.SslSettings |
Methods
CreateAsync(Address, Open, OnOpened)
Creates a new connection with a custom open frame and a callback to handle remote open frame.
Declaration
public Task<Connection> CreateAsync(Address address, Open open = null, OnOpened onOpened = null)
Parameters
Type | Name | Description |
---|---|---|
Address | address | The address of remote endpoint to connect to. |
Open | open | If specified, it is sent to open the connection, otherwise an open frame created from the AMQP settings property is sent. |
OnOpened | onOpened | If specified, it is invoked when an open frame is received from the remote peer. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Connection> | A task for the connection creation operation. On success, the result is an AMQP Connection |
CreateAsync(Address, IHandler)
Creates a new connection with a protocol handler.
Declaration
public Task<Connection> CreateAsync(Address address, IHandler handler)
Parameters
Type | Name | Description |
---|---|---|
Address | address | The address of remote endpoint to connect to. |
IHandler | handler | The protocol handler. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Connection> | A task for the connection creation operation. On success, the result is an AMQP Connection |
Explicit Interface Implementations
IConnectionFactory.CreateAsync(Address)
Declaration
Task<IConnection> IConnectionFactory.CreateAsync(Address address)
Parameters
Type | Name | Description |
---|---|---|
Address | address |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IConnection> |