Class PasvListenerFactory
Creates TcpListeners for use with PASV commands.
Implements
Inherited Members
Namespace: FubarDev.FtpServer
Assembly: FubarDev.FtpServer.dll
Syntax
public class PasvListenerFactory : IPasvListenerFactory
Constructors
| Improve this Doc View SourcePasvListenerFactory(IPasvAddressResolver, Nullable<ILogger<PasvListenerFactory>>)
Initializes a new instance of the PasvListenerFactory class.
Declaration
public PasvListenerFactory(IPasvAddressResolver addressResolver, ILogger<PasvListenerFactory>? logger = default(ILogger<PasvListenerFactory>? ))
Parameters
Type | Name | Description |
---|---|---|
IPasvAddressResolver | addressResolver | The address resolver for |
Nullable<ILogger<PasvListenerFactory>> | logger | Logger instance. |
Methods
| Improve this Doc View SourceCreateTcpListenerAsync(IFtpConnection, Nullable<AddressFamily>, Int32, CancellationToken)
Create a new TcpListener for the given connection.
Declaration
public Task<IPasvListener> CreateTcpListenerAsync(IFtpConnection connection, AddressFamily? addressFamily, int port, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IFtpConnection | connection | connection on which to create the tcp listener. |
Nullable<AddressFamily> | addressFamily | The address family for the address to be selected. |
Int32 | port | listen on the given port, or 0 for any port. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IPasvListener> | A TcpListener. |
Exceptions
Type | Condition |
---|---|
SocketException | Network error, such as no free port. |
ArgumentOutOfRangeException | The chosen port was not within the configured range of ports. |