You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the upgrade 3.0, you'll see that the `IFtpServer.Start` and `IFtpServer.Stop` functions are
36
39
deprecated. Please query the [`IFtpServerHost`](xref:FubarDev.FtpServer.IFtpServerHost) instead and
37
-
use the [`StartAsync`](xref:FubarDev.FtpServer.IFtpServerHost.StartAsync(CancellationToken))
38
-
and [`StopAsync`](xref:FubarDev.FtpServer.IFtpServerHost.StopAsync(CancellationToken)) functions instead.
40
+
use the [`StartAsync`](xref:FubarDev.FtpServer.IFtpServerHost.StartAsync(System.Threading.CancellationToken))
41
+
and [`StopAsync`](xref:FubarDev.FtpServer.IFtpServerHost.StopAsync(System.Threading.CancellationToken)) functions instead.
39
42
40
43
You will notice breaking changes in the following areas:
41
44
@@ -149,9 +152,46 @@ We're now using two factories to create data connections:
149
152
150
153
This factories create a [`IFtpDataConnectionFeature`](xref:FubarDev.FtpServer.Features.IFtpDataConnectionFeature) which is used to create [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) implementations. This allows us to abstract away the differences between active and passive data connections.
151
154
152
-
The function `IFtpConnection.CreateResponseSocket` was replaced by [`IFtpConnection.OpenDataConnectionAsync`](xref:FubarDev.FtpServer.IFtpConnection.OpenDataConnectionAsync(System.Nullable{TimeSpan},CancellationToken)) and returns a [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) implementation. This function also takes care of SSL/TLS encryption as it wraps the [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) implementation returned by the [`IFtpDataConnectionFeature`](xref:FubarDev.FtpServer.Features.IFtpDataConnectionFeature) into a new [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) implementation with the help of the [`SecureDataConnectionWrapper`](xref:FubarDev.FtpServer.DataConnection.SecureDataConnectionWrapper).
155
+
The function `IFtpConnection.CreateResponseSocket` was replaced by [`DataConnectionServerCommand`](xref:FubarDev.FtpServer.ServerCommands.DataConnectionServerCommand) server command.
156
+
The passed [`AsyncDataConnectionDelegate`](xref:FubarDev.FtpServer.ServerCommands.AsyncDataConnectionDelegate) gets an
157
+
[`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) implementation and may return a response.
158
+
This function also takes care of SSL/TLS encryption as it wraps the [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection)
159
+
implementation returned by the [`IFtpDataConnectionFeature`](xref:FubarDev.FtpServer.Features.IFtpDataConnectionFeature) into
160
+
a new [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection) implementation with the help of
161
+
the [`SecureDataConnectionWrapper`](xref:FubarDev.FtpServer.DataConnection.SecureDataConnectionWrapper).
153
162
154
-
The extension method `SendResponseAsync` on the `IFtpConnection` was replaced by [`SendDataAsync`](xref:FubarDev.FtpServer.ConnectionExtensions.SendDataAsync(FubarDev.FtpServer.IFtpConnection,Func{FubarDev.FtpServer.IFtpDataConnection,CancellationToken,Task{FubarDev.FtpServer.IFtpResponse}},ILogger,CancellationToken)) and takes care of closing the [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection).
163
+
The extension method `SendResponseAsync` on the `IFtpConnection` was replaced by the [`DataConnectionServerCommand`](xref:FubarDev.FtpServer.ServerCommands.DataConnectionServerCommand)
164
+
server command and takes care of closing the [`IFtpDataConnection`](xref:FubarDev.FtpServer.IFtpDataConnection).
165
+
166
+
## Connection checks
167
+
168
+
The FTP server allows to check if a connection is still active. It ensures that the server doesn't get filled with dead connections, where
169
+
the server didn't recognize that the client is gone (e.g. client crash, aborted TCP connection, etc...).
170
+
171
+
This was made possible by using the following two implementations for [`IFtpConnectionCheck`](xref:FubarDev.FtpServer.ConnectionChecks.IFtpConnectionCheck):
172
+
173
+
-[`FtpConnectionEstablishedCheck`](xref:FubarDev.FtpServer.ConnectionChecks.FtpConnectionEstablishedCheck) checks if the TCP connection is still established
174
+
-[`FtpConnectionIdleCheck`](xref:FubarDev.FtpServer.ConnectionChecks.FtpConnectionIdleCheck) checks if the connection is idle for too long
175
+
176
+
This checks are enabled by default and can be disabled and reenabled by the following extension methods for
177
+
the [`IFtpServerBuilder`](xref:FubarDev.FtpServer.IFtpServerBuilder):
178
+
179
+
-[`DisableChecks`](xref:FubarDev.FtpServer.FtpServerBuilderExtensionsForChecks.DisableChecks*) disables all checks (the default ones and the ones manually enabled before)
180
+
-[`EnableDefaultChecks`](xref:FubarDev.FtpServer.FtpServerBuilderExtensionsForChecks.EnableDefaultChecks*) enables all default checks (see above)
181
+
-[`EnableIdleCheck`](xref:FubarDev.FtpServer.FtpServerBuilderExtensionsForChecks.EnableIdleCheck*) enables the check for an idle connection
182
+
-[`EnableConnectionCheck`](xref:FubarDev.FtpServer.FtpServerBuilderExtensionsForChecks.EnableConnectionCheck*) enables the check for an establised TCP connection
183
+
-[`DisableIdleCheck`](xref:FubarDev.FtpServer.FtpServerBuilderExtensionsForChecks.DisableIdleCheck*) enables the check for an idle connection
184
+
-[`DisableConnectionCheck`](xref:FubarDev.FtpServer.FtpServerBuilderExtensionsForChecks.DisableConnectionCheck*) disables the check for an establised TCP connection
185
+
186
+
The checks above are enabled by default.
187
+
188
+
### Idle check
189
+
190
+
The idle check determines if the connection was idle for too long. The default timeout is 5 minutes, configured through [`FtpConnectionOptions.InactivityTimeout`](xref:FubarDev.FtpServer.FtpConnectionOptions.InactivityTimeout).
191
+
192
+
### Connection check
193
+
194
+
This determines if the TCP connection is still established by sending an empty data packet to the client.
155
195
156
196
# FTP middleware
157
197
@@ -268,6 +308,7 @@ and [`FtpCommandCollector`](xref:FubarDev.FtpServer.FtpCommandCollector).
268
308
- Root and home directories for an account can be queried
269
309
- New [`IFtpMiddleware`](xref:FubarDev.FtpServer.IFtpMiddleware) interface for custom request middleware
270
310
- New [`IFtpCommandMiddleware`](xref:FubarDev.FtpServer.Commands.IFtpCommandMiddleware) interface for custom command execution middleware
<pre><codeclass="lang-csharp hljs">public class BlockAnonymousValidation : object, IAnonymousPasswordValidator</code></pre>
126
+
<pre><codeclass="lang-csharp hljs">public class BlockAnonymousValidation : IAnonymousPasswordValidator</code></pre>
103
127
</div>
104
128
<h3id="methods">Methods
105
129
</h3>
@@ -108,12 +132,11 @@ <h3 id="methods">Methods
108
132
<ahref="https://github.com/FubarDevelopment/FtpServer/new/master/docfx_project/apidoc/new?filename=FubarDev_FtpServer_AccountManagement_Anonymous_BlockAnonymousValidation_IsValid_System_String_.md&value=---%0Auid%3A%20FubarDev.FtpServer.AccountManagement.Anonymous.BlockAnonymousValidation.IsValid(System.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
<ahref="https://github.com/FubarDevelopment/FtpServer/new/master/docfx_project/apidoc/new?filename=FubarDev_FtpServer_AccountManagement_Anonymous_BlockAnonymousValidation.md&value=---%0Auid%3A%20FubarDev.FtpServer.AccountManagement.Anonymous.BlockAnonymousValidation%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
Copy file name to clipboardExpand all lines: docs/api/FubarDev.FtpServer.AccountManagement.Anonymous.IAnonymousPasswordValidator.html
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ <h3 id="methods">Methods
99
99
<ahref="https://github.com/FubarDevelopment/FtpServer/new/master/docfx_project/apidoc/new?filename=FubarDev_FtpServer_AccountManagement_Anonymous_IAnonymousPasswordValidator_IsValid_System_String_.md&value=---%0Auid%3A%20FubarDev.FtpServer.AccountManagement.Anonymous.IAnonymousPasswordValidator.IsValid(System.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
<ahref="https://github.com/FubarDevelopment/FtpServer/new/master/docfx_project/apidoc/new?filename=FubarDev_FtpServer_AccountManagement_Anonymous_IAnonymousPasswordValidator.md&value=---%0Auid%3A%20FubarDev.FtpServer.AccountManagement.Anonymous.IAnonymousPasswordValidator%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
0 commit comments