NfNitLoop / feoblog

A distributed, cryptographically-verifiable blog / social network
Other
71 stars 4 forks source link

Gracefully close socket on shutdown #81

Open NfNitLoop opened 2 years ago

NfNitLoop commented 2 years ago

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 commented 1 year ago

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.