bjoern icon indicating copy to clipboard operation
bjoern copied to clipboard

unix sockets aren't released on SIGHUP

Open slayerjain opened this issue 3 years ago • 3 comments

I'm on macOS 11.5.2. After stopping the server via SIGHUP and then starting again on the same Unix socket I get the following error:

OSError: [Errno 48] Address already in use

Is this expected? I currently have to keep changing the Unix socket path every time I restart the server from my IDE.

slayerjain avatar Aug 28 '21 17:08 slayerjain

Not expected, PR welcome.

jonashaag avatar Aug 29 '21 09:08 jonashaag

Hi, what is not expected? Is it normal to not release a port after the process terminates? I think no. If it must be done could you point the part of the code to be modified ? Thanks

jefcolbi avatar Sep 12 '21 01:09 jefcolbi

I think, for example, you can use the ev_signal_on_sigint function https://github.com/jonashaag/bjoern/blob/4297a64bf0ed9e37788cef573dcce582170960d1/bjoern/server.c#L119

faunris avatar Dec 24 '21 12:12 faunris