network-conduit 0.6.2 → 0.6.2.1
raw patch · 3 files changed
+10/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/Conduit/Network/Utils.hs +7/−2
- network-conduit.cabal +1/−1
- test/main.hs +2/−2
Data/Conduit/Network/Utils.hs view
@@ -89,13 +89,18 @@ (\(_ :: IOException) -> tryAddrs rest) tryAddrs (addr1:[]) = theBody addr1 tryAddrs _ = error "bindPort: addrs is empty"++ sockOpts =+ case sockettype of+ NS.Datagram -> [(NS.ReuseAddr,1)]+ _ -> [(NS.NoDelay,1), (NS.ReuseAddr,1)]+ theBody addr = bracketOnError (NS.socket (NS.addrFamily addr) (NS.addrSocketType addr) (NS.addrProtocol addr)) NS.sClose (\sock -> do- NS.setSocketOption sock NS.ReuseAddr 1- NS.setSocketOption sock NS.NoDelay 1+ mapM_ (\(opt,v) -> NS.setSocketOption sock opt v) sockOpts NS.bindSocket sock (NS.addrAddress addr) return sock )
network-conduit.cabal view
@@ -1,5 +1,5 @@ Name: network-conduit-Version: 0.6.2+Version: 0.6.2.1 Synopsis: Stream socket data using conduits. Description: Stream socket data using conduits. License: BSD3
test/main.hs view
@@ -6,10 +6,10 @@ main :: IO () main = do- _ <- forkIO $ runTCPServer (serverSettings 4000 "*4") echo+ _ <- forkIO $ runTCPServer (serverSettings 4009 "*4") echo threadDelay 1000000 replicateM_ 10000- $ runTCPClient (clientSettings 4000 "localhost") doNothing+ $ runTCPClient (clientSettings 4009 "localhost") doNothing echo :: Application IO echo ad = appSource ad $$ appSink ad