Skip to content

Commit

Permalink
maxListenQueue is 128. This is too short. So, specify 2048 to the lis…
Browse files Browse the repository at this point in the history
…ten queue.
  • Loading branch information
kazu-yamamoto committed Oct 11, 2012
1 parent 23f700c commit 5b1f9f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion network-conduit/Data/Conduit/Network.hs
Expand Up @@ -167,12 +167,15 @@ getSocket host' port' = do

-- | Attempt to bind a listening @Socket@ on the given host/port. If no host is
-- given, will use the first address available.
-- 'maxListenQueue' is topically 128 which is too short for
-- high performance servers. So, we specify 'max 2048 maxListenQueue' to
-- the listen queue.
--
-- Since 0.3.0
bindPort :: Int -> HostPreference -> IO Socket
bindPort p s = do
sock <- Utils.bindPort p s NS.Stream
NS.listen sock NS.maxListenQueue
NS.listen sock (max 2048 NS.maxListenQueue)
return sock

-- | Try to accept a connection, recovering automatically from exceptions.
Expand Down

0 comments on commit 5b1f9f0

Please sign in to comment.