socket 0.1.0.0 → 0.1.0.1
raw patch · 5 files changed
+50/−21 lines, 5 filesdep ~basedep ~bytestring
Dependency ranges changed: base, bytestring
Files
- CHANGELOG.md +9/−0
- README.md +32/−0
- socket.cabal +7/−5
- src/System/Socket/Internal/Event.hs +1/−16
- src/System/Socket/Unsafe.hsc +1/−0
+ CHANGELOG.md view
@@ -0,0 +1,9 @@+0.1.0.1 Lars Petersen <info@lars-petersen.net> 2015-05-28++ * Added CHANGELOG.md+ * Removed `threadWaitReadMVar` and `threadWaitWriteMVar`+ * Import `Data.Monoid` in `System.Socket.Unsafe` to support older Preludes++0.1.0.0 Lars Petersen <info@lars-petersen.net> 2015-05-28++ * Initial release
+ README.md view
@@ -0,0 +1,32 @@+socket+======++[![Available on Hackage][badge-hackage]][hackage]+[![License MIT][badge-license]][license]+[![Build Status][badge-travis]][travis]++### Motivation++ - Have a typesafe and easy-to-use binding to all kinds of Posix sockets.++### Dependencies++ - base+ - bytestring++### Tests++Run the default test suite:++```bash+cabal test+```++[badge-travis]: https://img.shields.io/travis/lpeterse/haskell-socket.svg+[travis]: https://travis-ci.org/lpeterse/haskell-socket+[badge-hackage]: https://img.shields.io/hackage/v/socket.svg?dummy+[hackage]: https://hackage.haskell.org/package/socket+[badge-license]: https://img.shields.io/badge/license-MIT-green.svg?dummy+[license]: https://github.com/lpeterse/haskell-socket/blob/master/LICENSE+[issues]: https://github.com/lpeterse/haskell-socket/issues+[Github]: https://github.com/lpeterse/haskell-socket
socket.cabal view
@@ -1,13 +1,13 @@ name: socket-version: 0.1.0.0+version: 0.1.0.1 synopsis: A binding to the POSIX sockets interface description: This package provides access to the system's socket interface with POSIX semantics. . The library is designed to be threadsafe and establishes a thin layer on top of the underlying ccalls to help with the development of concurrent applications.- It integrates with GHC's event management mechanism (which itself uses epoll- or libev or similar) and makes all functions have blocking semantics+ It integrates with GHC's event management mechanism (which itself uses epoll,+ libev or similar) and makes all functions have blocking semantics without actually blocking the runtime system. license: MIT license-file: LICENSE@@ -18,6 +18,8 @@ cabal-version: >=1.10 homepage: https://github.com/lpeterse/haskell-socket bug-reports: https://github.com/lpeterse/haskell-socket/issues+tested-with: GHC==7.10.1, GHC==7.8.3+extra-source-files: README.md CHANGELOG.md library exposed-modules: System.Socket@@ -38,7 +40,7 @@ , System.Socket.Internal.Event , System.Socket.Internal.Socket build-depends: base < 5- , bytestring+ , bytestring < 0.11 hs-source-dirs: src build-tools: hsc2hs default-language: Haskell2010@@ -54,7 +56,7 @@ type: exitcode-stdio-1.0 default-language: Haskell2010 build-depends: base < 5- , bytestring+ , bytestring < 0.11 , socket , async
src/System/Socket/Internal/Event.hs view
@@ -1,9 +1,8 @@ module System.Socket.Internal.Event- ( threadWaitReadMVar, threadWaitWriteMVar, threadWaitWrite', threadWaitRead'+ ( threadWaitWrite', threadWaitRead' ) where import Control.Concurrent.MVar-import Control.Exception import Control.Monad import Foreign.C.Error@@ -17,20 +16,6 @@ ------------------------------------------------------------------------------- -- Helpers for threadsafe event registration on file descriptors ---------------------------------------------------------------------------------threadWaitReadMVar :: MVar Fd -> IO ()-threadWaitReadMVar mfd = do- wait <- withMVar mfd $ \fd-> do- when (fd < 0) $ throwIO (SocketException eBADF)- threadWaitReadSTM fd >>= return . atomically . fst- wait `onException` throwIO (SocketException eBADF)--threadWaitWriteMVar :: MVar Fd -> IO ()-threadWaitWriteMVar mfd = do- wait <- withMVar mfd $ \fd-> do- when (fd < 0) $ throwIO (SocketException eBADF)- threadWaitWriteSTM fd >>= return . atomically . fst- wait `onException` throwIO (SocketException eBADF) threadWaitWrite' :: Fd -> IO (IO ()) threadWaitWrite' fd = do
src/System/Socket/Unsafe.hsc view
@@ -10,6 +10,7 @@ ) where import Data.Function+import Data.Monoid import Control.Monad import Control.Exception