Closed wasabii closed 5 years ago
You mean something like a pause/resume? No, it's not implemented, but a pull request is welcome 😊.
Will be fixed in 3.0.0-rc.4 or 3.0.0 (whatever comes first).
I'm not really happy with the API, but I cannot think of a better one:
// Get the FTP server
var ftpServer = serviceProvider.GetRequiredService<IFtpServer>();
// Cast to ICommunicationService and pause the server (accepting connections)
await ((ICommunicationService)ftpServer).PauseAsync(CancellationToken.None);
// Cast to ICommunicationService and continue the server (accepting connections)
await ((ICommunicationService)ftpServer).ContinueAsync(CancellationToken.None);
Is there a way to deny new connections to the server (stop the listener) without stopping existing connections? I would like to implement the ability to wait for connections to exit before Stop is processed.