We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d82bf1 commit 9529569Copy full SHA for 9529569
Network/Socket/Shutdown.hs
@@ -51,10 +51,13 @@ gracefulClose s tmout = sendRecvFIN `E.finally` close s
51
where
52
sendRecvFIN = do
53
-- Sending TCP FIN.
54
- shutdown s ShutdownSend
55
- -- Waiting TCP FIN.
56
- E.bracket (mallocBytes bufSize) free $ \buf -> do
57
- {-# SCC "" #-} recvEOFloop buf
+ ex <- E.try $ shutdown s ShutdownSend
+ case ex of
+ Left (E.SomeException _) -> return ()
+ Right () -> do
58
+ -- Waiting TCP FIN.
59
+ E.bracket (mallocBytes bufSize) free $ \buf -> do
60
+ {-# SCC "" #-} recvEOFloop buf
61
-- milliseconds. Taken from BSD fast clock value.
62
clock = 200
63
recvEOFloop buf = loop 0
0 commit comments