metro 0.1.0.1 → 0.1.0.2
raw patch · 2 files changed
+8/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- metro.cabal +2/−2
- src/Metro/TP/BS.hs +6/−3
metro.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 124f20e53bf16376d862c5d84dd92ae18ac0dcaaca36281152e40f7d65acc566+-- hash: 24d5ce7bcac547eb3eeb276c1486b3d82bc04c04fc1805c000dd3d0b3f402547 name: metro-version: 0.1.0.1+version: 0.1.0.2 synopsis: A simple tcp and udp socket server framework description: Please see the README on GitHub at <https://github.com/Lupino/metro#readme> category: Network,Framework
src/Metro/TP/BS.hs view
@@ -26,7 +26,7 @@ newBSHandle_ :: MonadIO m => Int -> ByteString -> m BSHandle newBSHandle_ size bs = do- state <- newTVarIO True+ state <- newTVarIO False BSHandle size state <$> newTVarIO bs feed :: MonadIO m => BSHandle -> ByteString -> m ()@@ -48,7 +48,8 @@ instance Transport BSTransport where data TransportConfig BSTransport = BSConfig BSHandle (ByteString -> IO ())- newTransport (BSConfig (BSHandle _ bsState bsHandle) bsWriter) =+ newTransport (BSConfig (BSHandle _ bsState bsHandle) bsWriter) = do+ atomically $ writeTVar bsState True return BS {..} recvData BS {..} nbytes = atomically $ do bs <- readTVar bsHandle@@ -62,7 +63,9 @@ sendData BS {..} bs = do status <- readTVarIO bsState when status $ bsWriter bs- closeTransport BS {..} = atomically $ writeTVar bsState False+ closeTransport BS {..} = atomically $ do+ writeTVar bsState False+ writeTVar bsHandle empty bsTransportConfig :: BSHandle -> (ByteString -> IO ()) -> TransportConfig BSTransport bsTransportConfig = BSConfig