zeromq4-haskell 0.6.1 → 0.6.2
raw patch · 4 files changed
+22/−12 lines, 4 files
Files
- CHANGELOG.md +4/−0
- src/System/ZMQ4.hs +13/−11
- src/System/ZMQ4/Internal.hs +4/−0
- zeromq4-haskell.cabal +1/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+0.6.2+-----------------------------------------------------------------------------+- Bug fixes: #56 (we no longer call zmq_msg_close after successfull sends)+ 0.6.1 ----------------------------------------------------------------------------- - Bug fixes: #55
src/System/ZMQ4.hs view
@@ -792,14 +792,15 @@ -- by default. Still 'send' is blocking the thread as long as the message -- can not be queued on the socket using GHC's 'threadWaitWrite'. send :: Sender a => Socket a -> [Flag] -> SB.ByteString -> IO ()-send sock fls val = bracket (messageOf val) messageClose $ \m ->- onSocket "send" sock $ \s ->- retry "send" (waitWrite sock) $+send sock fls val = bracketOnError (messageOf val) messageClose $ \m -> do+ onSocket "send" sock $ \s ->+ retry "send" (waitWrite sock) $ #ifdef mingw32_HOST_OS- c_zmq_sendmsg s (msgPtr m) (combineFlags fls)+ c_zmq_sendmsg s (msgPtr m) (combineFlags fls) #else- c_zmq_sendmsg s (msgPtr m) (combineFlags (DontWait : fls))+ c_zmq_sendmsg s (msgPtr m) (combineFlags (DontWait : fls)) #endif+ messageFree m -- | Send the given 'LB.ByteString' over the socket -- (cf. <http://api.zeromq.org/4-0:zmq-sendmsg zmq_sendmsg>).@@ -812,14 +813,15 @@ -- by default. Still 'send'' is blocking the thread as long as the message -- can not be queued on the socket using GHC's 'threadWaitWrite'. send' :: Sender a => Socket a -> [Flag] -> LB.ByteString -> IO ()-send' sock fls val = bracket (messageOfLazy val) messageClose $ \m ->- onSocket "send'" sock $ \s ->- retry "send'" (waitWrite sock) $+send' sock fls val = bracketOnError (messageOfLazy val) messageClose $ \m -> do+ onSocket "send'" sock $ \s ->+ retry "send'" (waitWrite sock) $ #ifdef mingw32_HOST_OS- c_zmq_sendmsg s (msgPtr m) (combineFlags fls)+ c_zmq_sendmsg s (msgPtr m) (combineFlags fls) #else- c_zmq_sendmsg s (msgPtr m) (combineFlags (DontWait : fls))+ c_zmq_sendmsg s (msgPtr m) (combineFlags (DontWait : fls)) #endif+ messageFree m -- | Send a multi-part message. -- This function applies the 'SendMore' 'Flag' between all message parts.@@ -979,7 +981,7 @@ -- -- Proxy connects front to back socket ----- Before calling proxy all sockets should be binded+-- Before calling proxy all sockets should be bound -- -- If the capture socket is not Nothing, the proxy shall send all -- messages, received on both frontend and backend, to the capture socket.
src/System/ZMQ4/Internal.hs view
@@ -20,6 +20,7 @@ , messageOf , messageOfLazy , messageClose+ , messageFree , messageInit , messageInitSize , setIntOpt@@ -207,6 +208,9 @@ messageClose (Message ptr) = do throwIfMinus1_ "messageClose" $ c_zmq_msg_close ptr free ptr++messageFree :: Message -> IO ()+messageFree (Message ptr) = free ptr messageInit :: IO Message messageInit = do
zeromq4-haskell.cabal view
@@ -1,5 +1,5 @@ name: zeromq4-haskell-version: 0.6.1+version: 0.6.2 synopsis: Bindings to ZeroMQ 4.x category: System, FFI license: MIT