feoblog icon indicating copy to clipboard operation
feoblog copied to clipboard

Gracefully close socket on shutdown

Open NfNitLoop opened this issue 3 years ago • 1 comments

I'm (somewhat hackily) just running FeoBlog in a terminal window. To shut it down, I press Ctrl-C. It seems that just forces Actix-Web to exit its event loop and end the program. If I try to restart the process, for a minute or so it can't start because the port is still "in use".

Probably need to have it gracefully close the socket on shutdown. I remember this being a thing that wasn't yet implemented in Tide. Hopefully Actix-Web has a better story here.

Oddly, I don't remember this being an issue when developing in Windows.

NfNitLoop avatar Mar 18 '22 03:03 NfNitLoop

Oddly, I don't remember this being an issue when developing in Windows.

Possibly because the default behavior in Windows is to allow other processes to yoink the port away from your application. IIRC I changed this behavior at some point. So yeah, should implement graceful shutdown.

NfNitLoop avatar Apr 04 '23 23:04 NfNitLoop