Show / Hide Table of Contents

    Class FtpConnection

    This class represents a FTP connection.

    Inheritance
    Object
    FtpConnectionContext
    FtpConnection
    Implements
    IFtpConnection
    IConnectionFeature
    IDisposable
    IObservable<IFtpConnectionEvent>
    IFtpConnectionEventHost
    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 FtpConnection : FtpConnectionContext, IFtpConnection, IConnectionFeature, IDisposable, IObservable<IFtpConnectionEvent>, IFtpConnectionEventHost

    Constructors

    | Improve this Doc View Source

    FtpConnection(TcpSocketClientAccessor, IOptions<FtpConnectionOptions>, IOptions<PortCommandOptions>, IFtpConnectionAccessor, IFtpCatalogLoader, IServerCommandExecutor, IServiceProvider, SecureDataConnectionWrapper, ISslStreamWrapperFactory, Nullable<ILogger<FtpConnection>>, Nullable<ILoggerFactory>)

    Initializes a new instance of the FtpConnection class.

    Declaration
    public FtpConnection(TcpSocketClientAccessor socketAccessor, IOptions<FtpConnectionOptions> options, IOptions<PortCommandOptions> portOptions, IFtpConnectionAccessor connectionAccessor, IFtpCatalogLoader catalogLoader, IServerCommandExecutor serverCommandExecutor, IServiceProvider serviceProvider, SecureDataConnectionWrapper secureDataConnectionWrapper, ISslStreamWrapperFactory sslStreamWrapperFactory, ILogger<FtpConnection>? logger = default(ILogger<FtpConnection>? ), ILoggerFactory? loggerFactory = default(ILoggerFactory? ))
    Parameters
    Type Name Description
    TcpSocketClientAccessor socketAccessor

    The accessor to get the socket used to communicate with the client.

    IOptions<FtpConnectionOptions> options

    The options for the FTP connection.

    IOptions<PortCommandOptions> portOptions

    The PORT command options.

    IFtpConnectionAccessor connectionAccessor

    The accessor to get the connection that is active during the Process(FtpCommand, CancellationToken) method execution.

    IFtpCatalogLoader catalogLoader

    The catalog loader for the FTP server.

    IServerCommandExecutor serverCommandExecutor

    The executor for server commands.

    IServiceProvider serviceProvider

    The service provider for the connection.

    SecureDataConnectionWrapper secureDataConnectionWrapper

    Wraps a data connection into an SSL stream.

    ISslStreamWrapperFactory sslStreamWrapperFactory

    The SSL stream wrapper factory.

    Nullable<ILogger<FtpConnection>> logger

    The logger for the FTP connection.

    Nullable<ILoggerFactory> loggerFactory

    The logger factory.

    Properties

    | Improve this Doc View Source

    ConnectionId

    Gets or sets the connection identifier.

    Declaration
    public override string ConnectionId { get; set; }
    Property Value
    Type Description
    String
    Overrides
    FtpConnectionContext.ConnectionId
    | Improve this Doc View Source

    ConnectionServices

    Gets the connection services.

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

    Data

    Gets the FTP connection data.

    Declaration
    [Obsolete("Query the information using the Features property instead.")]
    public FtpConnectionData Data { get; }
    Property Value
    Type Description
    FtpConnectionData
    | Improve this Doc View Source

    Encoding

    Gets or sets the encoding for the LIST/NLST commands.

    Declaration
    [Obsolete("Query the information using the IEncodingFeature instead.")]
    public Encoding Encoding { get; set; }
    Property Value
    Type Description
    Encoding
    | Improve this Doc View Source

    Features

    Gets the feature collection.

    Declaration
    public override IFeatureCollection Features { get; }
    Property Value
    Type Description
    IFeatureCollection
    Overrides
    FtpConnectionContext.Features
    | Improve this Doc View Source

    IsSecure

    Gets a value indicating whether this is a secure connection.

    Declaration
    [Obsolete("Not needed anymore.")]
    public bool IsSecure { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    LocalEndPoint

    Gets the local end point.

    Declaration
    [Obsolete("Query the information using the IConnectionFeature instead.")]
    public IPEndPoint LocalEndPoint { get; }
    Property Value
    Type Description
    IPEndPoint
    | Improve this Doc View Source

    Log

    Gets the FTP connection logger.

    Declaration
    [Obsolete("Use your own logger instead of the one from the connection.")]
    public ILogger? Log { get; }
    Property Value
    Type Description
    Nullable<ILogger>
    | Improve this Doc View Source

    OriginalStream

    Gets the control connection stream.

    Declaration
    [Obsolete("Query the information using the ISecureConnectionFeature instead.")]
    public Stream OriginalStream { get; }
    Property Value
    Type Description
    Stream
    | Improve this Doc View Source

    RemoteAddress

    Gets the remote address of the client.

    Declaration
    [Obsolete("Query the information using the IConnectionFeature instead - and use the RemoteEndPoint property.")]
    public Address RemoteAddress { get; }
    Property Value
    Type Description
    Address
    | Improve this Doc View Source

    RemoteEndPoint

    Gets the remote end point.

    Declaration
    [Obsolete("Query the information using the IConnectionFeature instead.")]
    public IPEndPoint RemoteEndPoint { get; }
    Property Value
    Type Description
    IPEndPoint
    | Improve this Doc View Source

    SocketStream

    Gets or sets the control connection stream.

    Declaration
    [Obsolete("Not needed anymore.")]
    public Stream SocketStream { get; set; }
    Property Value
    Type Description
    Stream

    Methods

    | Improve this Doc View Source

    CreateEncryptedStream(Stream)

    Create an encrypted stream.

    Declaration
    [Obsolete("The data connection returned by OpenDataConnection is already encrypted.")]
    public Task<Stream> CreateEncryptedStream(Stream unencryptedStream)
    Parameters
    Type Name Description
    Stream unencryptedStream

    The stream to encrypt.

    Returns
    Type Description
    Task<Stream>

    The encrypted stream.

    | Improve this Doc View Source

    Dispose()

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

    OpenDataConnectionAsync(Nullable<TimeSpan>, CancellationToken)

    Creates a response socket for e.g. LIST/NLST.

    Declaration
    public Task<IFtpDataConnection> OpenDataConnectionAsync(TimeSpan? timeout, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    Nullable<TimeSpan> timeout

    The timeout for establishing a data connection.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<IFtpDataConnection>

    The data connection.

    | Improve this Doc View Source

    PublishEvent(IFtpConnectionEvent)

    Publish the event.

    Declaration
    public void PublishEvent(IFtpConnectionEvent evt)
    Parameters
    Type Name Description
    IFtpConnectionEvent evt

    The event to publish.

    | Improve this Doc View Source

    StartAsync()

    Starts processing of messages for this connection.

    Declaration
    public Task StartAsync()
    Returns
    Type Description
    Task

    The task.

    | Improve this Doc View Source

    StopAsync()

    Closes the connection.

    Declaration
    public Task StopAsync()
    Returns
    Type Description
    Task

    The task.

    | Improve this Doc View Source

    Subscribe(IObserver<IFtpConnectionEvent>)

    Declaration
    public IDisposable Subscribe(IObserver<IFtpConnectionEvent> observer)
    Parameters
    Type Name Description
    IObserver<IFtpConnectionEvent> observer
    Returns
    Type Description
    IDisposable
    | Improve this Doc View Source

    WriteAsync(IFtpResponse, CancellationToken)

    Writes a FTP response to a client.

    Declaration
    [Obsolete("Use the IConnectionFeature.ServerCommandWriter instead.")]
    public Task WriteAsync(IFtpResponse response, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IFtpResponse response

    The response to write to the client.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task

    The task.

    | Improve this Doc View Source

    WriteAsync(String, CancellationToken)

    Writes response to a client.

    Declaration
    [Obsolete("Use the IConnectionFeature.ServerCommandWriter instead.")]
    public Task WriteAsync(string response, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    String response

    The response to write to the client.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task

    The task.

    Events

    | Improve this Doc View Source

    Closed

    Gets or sets the event handler that is triggered when the connection is closed.

    Declaration
    public event EventHandler? Closed
    Event Type
    Type Description
    Nullable<EventHandler>

    Implements

    IFtpConnection
    IConnectionFeature
    System.IDisposable
    System.IObservable<T>
    IFtpConnectionEventHost
    • 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.