trying to close tcp stuff on respawn

This commit is contained in:
Dmitry Zuikov 2023-05-25 13:19:34 +03:00
parent 52284f61ab
commit 27b8fb9f40
2 changed files with 3 additions and 1 deletions

View File

@ -422,10 +422,12 @@ runMessagingTCP env = liftIO do
liftIO (
listen (Host (show i)) (show p) $ \(sock, sa) -> do
withFdSocket sock setCloseOnExecIfNeeded
debug $ "Listening on" <+> pretty sa
forever do
void $ acceptFork sock $ \(so, remote) -> do
withFdSocket so setCloseOnExecIfNeeded
trace $ "GOT INCOMING CONNECTION FROM"
<+> brackets (pretty own)
<+> brackets (pretty sa)

View File

@ -267,7 +267,7 @@ runCLI = join . customExecParser (prefs showHelpOnError) $
c <- optional confOpt
resp <- optional $ flag' True ( long "respawn" <> short 'r' <> help "respawn process")
resp <- optional $ flag' True ( long "respawn" <> short 'R' <> help "respawn process")
pure $ PeerOpts pref l r k c resp