Interface IFtpConnection
The interface for an FTP connection.
Inherited Members
Namespace: FubarDev.FtpServer
Assembly: FubarDev.FtpServer.Abstractions.dll
Syntax
public interface IFtpConnection : IConnectionFeature, IDisposable
Properties
| Improve this Doc View SourceConnectionServices
Gets the connection services.
Declaration
IServiceProvider ConnectionServices { get; }
Property Value
Type | Description |
---|---|
IServiceProvider |
Data
Gets the FTP connection data.
Declaration
[Obsolete("Query the information using the Features property instead.")]
FtpConnectionData Data { get; }
Property Value
Type | Description |
---|---|
FtpConnectionData |
Encoding
Gets or sets the encoding for the LIST/NLST commands.
Declaration
[Obsolete("Query the information using the IEncodingFeature instead.")]
Encoding Encoding { get; set; }
Property Value
Type | Description |
---|---|
Encoding |
Features
Gets the feature collection.
Declaration
IFeatureCollection Features { get; }
Property Value
Type | Description |
---|---|
IFeatureCollection |
IsSecure
Gets a value indicating whether this is a secure connection.
Declaration
[Obsolete("Query the information using the ISecureConnectionFeature instead.")]
bool IsSecure { get; }
Property Value
Type | Description |
---|---|
Boolean |
Log
Gets the FTP connection logger.
Declaration
[Obsolete("Use your own logger instead of the one from the connection.")]
ILogger? Log { get; }
Property Value
Type | Description |
---|---|
Nullable<ILogger> |
OriginalStream
Gets the control connection stream.
Declaration
[Obsolete("Query the information using the ISecureConnectionFeature instead.")]
Stream OriginalStream { get; }
Property Value
Type | Description |
---|---|
Stream |
SocketStream
Gets or sets the control connection stream.
Declaration
[Obsolete("Query the information using the ISecureConnectionFeature instead.")]
Stream SocketStream { get; set; }
Property Value
Type | Description |
---|---|
Stream |
Methods
| Improve this Doc View SourceCreateEncryptedStream(Stream)
Create an encrypted stream.
Declaration
[Obsolete("The data connection returned by OpenDataConnection is already encrypted.")]
Task<Stream> CreateEncryptedStream(Stream unencryptedStream)
Parameters
Type | Name | Description |
---|---|---|
Stream | unencryptedStream | The stream to encrypt. |
Returns
Type | Description |
---|---|
Task<Stream> | The encrypted stream. |
OpenDataConnectionAsync(Nullable<TimeSpan>, CancellationToken)
Creates a response socket for e.g. LIST/NLST.
Declaration
Task<IFtpDataConnection> OpenDataConnectionAsync(TimeSpan? timeout = default(TimeSpan? ), CancellationToken cancellationToken = default(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. |
StartAsync()
Starts processing of messages for this connection.
Declaration
Task StartAsync()
Returns
Type | Description |
---|---|
Task | The task. |
StopAsync()
Closes the connection.
Declaration
Task StopAsync()
Returns
Type | Description |
---|---|
Task | The task. |
WriteAsync(IFtpResponse, CancellationToken)
Writes a FTP response to a client.
Declaration
[Obsolete("Use the FtpCommandHandler.CommandContext.ServerCommandWriter or FtpCommandHandlerExtension.CommandContext.ServerCommandWriter instead.")]
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. |
WriteAsync(String, CancellationToken)
Writes response to a client.
Declaration
[Obsolete("Use the FtpCommandHandler.CommandContext.ServerCommandWriter or FtpCommandHandlerExtension.CommandContext.ServerCommandWriter instead.")]
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 SourceClosed
Gets or sets the event handler that is triggered when the connection is closed.
Declaration
event EventHandler? Closed
Event Type
Type | Description |
---|---|
Nullable<EventHandler> |