-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29f4e61
commit 107486a
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ module Network.Socket.Shutdown ( | |
import qualified Control.Exception as E | ||
import Foreign.Marshal.Alloc (mallocBytes, free) | ||
|
||
import Control.Concurrent (threadDelay) | ||
import Control.Concurrent (threadDelay, yield) | ||
|
||
import Network.Socket.Buffer | ||
import Network.Socket.Imports | ||
|
@@ -55,6 +55,9 @@ gracefulClose s tmout0 = sendRecvFIN `E.finally` close s | |
case ex of | ||
Left (E.SomeException _) -> return () | ||
Right () -> do | ||
-- Giving CPU time to other threads hoping that | ||
-- FIN arrives meanwhile. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kazu-yamamoto
Author
Collaborator
|
||
yield | ||
-- Waiting TCP FIN. | ||
E.bracket (mallocBytes bufSize) free recvEOFloop | ||
recvEOFloop buf = loop 1 0 | ||
|
objective for end cycle