Closed jcorjaycee closed 3 years ago
services.Configure<FtpConnectionOptions>(opt =>
opt.InactivityTimeout = TimeSpan.FromSeconds(30));
Looks like I got that wrong, actually -- that's the device inactivity time out, and does nothing to shut down the server itself. Still looking for a solution!
You can reconfigure the connection timeout through FtpConnectionOptions
Total noob question here. I took a look at all the options provided at each step in the example Main configuration, but I couldn't find anything.
What I'm looking to do is have the server shut down if no requests are received after x number of seconds. Right now, I'm looking to do this with a Stopwatch object:
However, in order for this to work, I need the server to provide something akin to an EventHandler, so that when a new FTP message/request is received, this Stopwatch can be reset to 0 so the server keeps running. Does FtpServer offer this somewhere in the setup process?
If there is a better way to have the server shut down after inactivity, please let me know!