Show / Hide Table of Contents

    Class FtpServer

    The portable FTP server.

    Inheritance
    Object
    FtpServer
    Implements
    IFtpServer
    IPausableFtpService
    IFtpService
    IDisposable
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: FubarDev.FtpServer
    Assembly: FubarDev.FtpServer.dll
    Syntax
    public sealed class FtpServer : IFtpServer, IPausableFtpService, IFtpService, IDisposable

    Constructors

    | Improve this Doc View Source

    FtpServer(IOptions<FtpServerOptions>, IServiceProvider, IEnumerable<IFtpControlStreamAdapter>, Nullable<ILogger<FtpServer>>)

    Initializes a new instance of the FtpServer class.

    Declaration
    public FtpServer(IOptions<FtpServerOptions> serverOptions, IServiceProvider serviceProvider, IEnumerable<IFtpControlStreamAdapter> controlStreamAdapters, ILogger<FtpServer>? logger = default(ILogger<FtpServer>? ))
    Parameters
    Type Name Description
    IOptions<FtpServerOptions> serverOptions

    The server options.

    IServiceProvider serviceProvider

    The service provider used to query services.

    IEnumerable<IFtpControlStreamAdapter> controlStreamAdapters

    Adapters for the control connection stream.

    Nullable<ILogger<FtpServer>> logger

    The FTP server logger.

    Properties

    | Improve this Doc View Source

    MaxActiveConnections

    Gets the max allows active connections.

    Declaration
    public int MaxActiveConnections { get; }
    Property Value
    Type Description
    Int32
    Remarks

    This will cause connections to be refused if count is exceeded. 0 (default) means no control over connection count.

    | Improve this Doc View Source

    Port

    Gets the port on which the FTP server is listening for incoming connections.

    Declaration
    public int Port { get; }
    Property Value
    Type Description
    Int32
    Remarks

    This value is only final after the ListenerStarted event was raised.

    | Improve this Doc View Source

    Ready

    Gets a value indicating whether server ready to receive incoming connections.

    Declaration
    public bool Ready { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    ServerAddress

    Gets the public IP address (required for PASV and EPSV).

    Declaration
    public string? ServerAddress { get; }
    Property Value
    Type Description
    Nullable<String>
    | Improve this Doc View Source

    Statistics

    Gets the FTP server statistics.

    Declaration
    public IFtpServerStatistics Statistics { get; }
    Property Value
    Type Description
    IFtpServerStatistics
    | Improve this Doc View Source

    Status

    Gets the current status.

    Declaration
    public FtpServiceStatus Status { get; }
    Property Value
    Type Description
    FtpServiceStatus

    Methods

    | Improve this Doc View Source

    ContinueAsync(CancellationToken)

    Continues the FTP service.

    Declaration
    public Task ContinueAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task

    The task.

    | Improve this Doc View Source

    Dispose()

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    GetConnections()

    Returns all connections.

    Declaration
    public IEnumerable<IFtpConnection> GetConnections()
    Returns
    Type Description
    IEnumerable<IFtpConnection>

    The currently active connections.

    Remarks

    The connection might be closed between calling this function and using/querying the connection by the client.

    | Improve this Doc View Source

    PauseAsync(CancellationToken)

    Pauses the FTP service.

    Declaration
    public Task PauseAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task

    The task.

    | Improve this Doc View Source

    StartAsync(CancellationToken)

    Triggered when the application host is ready to start the service.

    Declaration
    public Task StartAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    Indicates that the start process has been aborted.

    Returns
    Type Description
    Task

    The task.

    | Improve this Doc View Source

    StopAsync(CancellationToken)

    Triggered when the application host is performing a graceful shutdown.

    Declaration
    public Task StopAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    Indicates that the shutdown process should no longer be graceful.

    Returns
    Type Description
    Task

    The task.

    Events

    | Improve this Doc View Source

    ConfigureConnection

    Declaration
    public event EventHandler<ConnectionEventArgs>? ConfigureConnection
    Event Type
    Type Description
    Nullable<EventHandler<ConnectionEventArgs>>
    | Improve this Doc View Source

    ListenerStarted

    Declaration
    public event EventHandler<ListenerStartedEventArgs>? ListenerStarted
    Event Type
    Type Description
    Nullable<EventHandler<ListenerStartedEventArgs>>

    Explicit Interface Implementations

    | Improve this Doc View Source

    IFtpServer.Start()

    Starts the FTP server in the background.

    Declaration
    [Obsolete("Use IFtpServerHost.StartAsync instead.")]
    void IFtpServer.Start()
    | Improve this Doc View Source

    IFtpServer.Stop()

    Stops the FTP server.

    Declaration
    [Obsolete("Use IFtpServerHost.StopAsync instead.")]
    void IFtpServer.Stop()
    Remarks

    The FTP server cannot be started again after it was stopped.

    Implements

    IFtpServer
    IPausableFtpService
    IFtpService
    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top
    Copyright © 2018 Fubar Development Junker
    Generated by DocFX
    Creative Commons License
    FluentMigrator Documentation by FluentMigrator Project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.