socket 0.8.0.0 → 0.8.0.1
raw patch · 8 files changed
+44/−36 lines, 8 files
Files
- CHANGELOG.md +5/−0
- README.md +3/−2
- socket.cabal +1/−1
- src/System/Socket.hsc +4/−0
- src/System/Socket/Family/Inet.hsc +0/−1
- src/System/Socket/Family/Inet6.hsc +0/−1
- src/System/Socket/Internal/AddressInfo.hsc +29/−29
- src/System/Socket/Internal/Socket.hs +2/−2
CHANGELOG.md view
@@ -1,3 +1,8 @@+0.8.0.1 Lars Petersen <info@lars-petersen.net> 2017-02-25++ * Issue 47: Fixed haddock documentation. + * Issue 46: Export `KeepAlive` socket option in the main module.+ 0.8.0.0 Lars Petersen <info@lars-petersen.net> 2017-02-25 * Issue 26: Show instances for `SocketException` and `AddressInfoException`
README.md view
@@ -76,10 +76,11 @@ RTS and the other against the multi-threaded one. Run `cabal test` or `stack test` to execute both in sequence. -[badge-travis]: https://img.shields.io/travis/lpeterse/haskell-socket.svg+[badge-travis]: https://img.shields.io/travis/lpeterse/haskell-socket.svg?label=Linux%20build [travis]: https://travis-ci.org/lpeterse/haskell-socket+[badge-appveyor]: https://img.shields.io/appveyor/ci/lpeterse/haskell-socket.svg?label=Windows%20build+[appveyor]: https://ci.appveyor.com/project/lpeterse/haskell-socket [badge-hackage]: https://img.shields.io/hackage/v/socket.svg?dummy-[badge-appveyor]: https://ci.appveyor.com/api/projects/status/i2il3a616s9yy48k/branch/master?svg=true [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
socket.cabal view
@@ -1,5 +1,5 @@ name: socket-version: 0.8.0.0+version: 0.8.0.1 synopsis: An extensible socket library. description: This library is a minimal cross-platform interface for
src/System/Socket.hsc view
@@ -76,8 +76,12 @@ , close -- * Options , SocketOption (..)+ -- ** Error , Error (..)+ -- ** ReuseAddress , ReuseAddress (..)+ -- ** KeepAlive+ , KeepAlive (..) -- * Name Resolution -- ** getAddressInfo , AddressInfo (..)
src/System/Socket/Family/Inet.hsc view
@@ -15,7 +15,6 @@ , InetAddress -- ** InetPort , InetPort- -- ** SocketAddress Inet , SocketAddress (SocketAddressInet, inetAddress, inetPort) -- * Custom addresses -- ** inetAddressFromTuple
src/System/Socket/Family/Inet6.hsc view
@@ -19,7 +19,6 @@ , Inet6FlowInfo -- ** Inet6ScopeId , Inet6ScopeId- -- ** SocketAddress Inet6 , SocketAddress (SocketAddressInet6, inet6Address, inet6Port, inet6FlowInfo, inet6ScopeId) -- * Custom addresses
src/System/Socket/Internal/AddressInfo.hsc view
@@ -221,35 +221,35 @@ -- | This class is for address families that support name resolution. class (Family f) => HasAddressInfo f where--- | Maps names to addresses (i.e. by DNS lookup).------ The operation throws `AddressInfoException`s.------ Contrary to the underlying @getaddrinfo@ operation this wrapper is--- typesafe and thus only returns records that match the address, type--- and protocol encoded in the type. This is the price we have to pay--- for typesafe sockets and extensibility.------ If you need different types of records, you need to start several--- queries. If you want to connect to both IPv4 and IPV6 addresses use--- `aiV4Mapped` and use IPv6-sockets.------ > getAddressInfo (Just "www.haskell.org") (Just "https") mempty :: IO [AddressInfo Inet Stream TCP]--- > > [AddressInfo {addressInfoFlags = AddressInfoFlags 0, socketAddress = SocketAddressInet {inetAddress = InetAddress 162.242.239.16, inetPort = InetPort 443}, canonicalName = Nothing}]------ > > getAddressInfo (Just "www.haskell.org") (Just "80") aiV4Mapped :: IO [AddressInfo Inet6 Stream TCP]--- > [AddressInfo {--- > addressInfoFlags = AddressInfoFlags 8,--- > socketAddress = SocketAddressInet6 {inet6Address = Inet6Address 2400:cb00:2048:0001:0000:0000:6ca2:cc3c, inet6Port = Inet6Port 80, inet6FlowInfo = Inet6FlowInfo 0, inet6ScopeId = Inet6ScopeId 0},--- > canonicalName = Nothing }]------ > > getAddressInfo (Just "darcs.haskell.org") Nothing aiV4Mapped :: IO [AddressInfo Inet6 Stream TCP]--- > [AddressInfo {--- > addressInfoFlags = AddressInfoFlags 8,--- > socketAddress = SocketAddressInet6 {inet6Address = Inet6Address 0000:0000:0000:0000:0000:ffff:17fd:e1ad, inet6Port = Inet6Port 0, inet6FlowInfo = Inet6FlowInfo 0, inet6ScopeId = Inet6ScopeId 0},--- > canonicalName = Nothing }]--- > > getAddressInfo (Just "darcs.haskell.org") Nothing mempty :: IO [AddressInfo Inet6 Stream TCP]--- > *** Exception: AddressInfoException "Name or service not known"+ -- | Maps names to addresses (i.e. by DNS lookup).+ --+ -- The operation throws `AddressInfoException`s.+ --+ -- Contrary to the underlying @getaddrinfo@ operation this wrapper is+ -- typesafe and thus only returns records that match the address, type+ -- and protocol encoded in the type. This is the price we have to pay+ -- for typesafe sockets and extensibility.+ --+ -- If you need different types of records, you need to start several+ -- queries. If you want to connect to both IPv4 and IPV6 addresses use+ -- `aiV4Mapped` and use IPv6-sockets.+ --+ -- > getAddressInfo (Just "www.haskell.org") (Just "https") mempty :: IO [AddressInfo Inet Stream TCP]+ -- > > [AddressInfo {addressInfoFlags = AddressInfoFlags 0, socketAddress = SocketAddressInet {inetAddress = InetAddress 162.242.239.16, inetPort = InetPort 443}, canonicalName = Nothing}]+ --+ -- > > getAddressInfo (Just "www.haskell.org") (Just "80") aiV4Mapped :: IO [AddressInfo Inet6 Stream TCP]+ -- > [AddressInfo {+ -- > addressInfoFlags = AddressInfoFlags 8,+ -- > socketAddress = SocketAddressInet6 {inet6Address = Inet6Address 2400:cb00:2048:0001:0000:0000:6ca2:cc3c, inet6Port = Inet6Port 80, inet6FlowInfo = Inet6FlowInfo 0, inet6ScopeId = Inet6ScopeId 0},+ -- > canonicalName = Nothing }]+ --+ -- > > getAddressInfo (Just "darcs.haskell.org") Nothing aiV4Mapped :: IO [AddressInfo Inet6 Stream TCP]+ -- > [AddressInfo {+ -- > addressInfoFlags = AddressInfoFlags 8,+ -- > socketAddress = SocketAddressInet6 {inet6Address = Inet6Address 0000:0000:0000:0000:0000:ffff:17fd:e1ad, inet6Port = Inet6Port 0, inet6FlowInfo = Inet6FlowInfo 0, inet6ScopeId = Inet6ScopeId 0},+ -- > canonicalName = Nothing }]+ -- > > getAddressInfo (Just "darcs.haskell.org") Nothing mempty :: IO [AddressInfo Inet6 Stream TCP]+ -- > *** Exception: AddressInfoException "Name or service not known" getAddressInfo :: (Type t, Protocol p) => Maybe BS.ByteString -> Maybe BS.ByteString -> AddressInfoFlags -> IO [AddressInfo f t p] instance HasAddressInfo Inet where
src/System/Socket/Internal/Socket.hs view
@@ -48,8 +48,8 @@ -- | The address `Family` determines the network protocol to use. ----- The most common address families are `System.Socket.Family.Inet` (IPv4)--- and `System.Socket.Family.Inet6` (IPv6).+-- The most common address families are `System.Socket.Family.Inet.Inet` (IPv4)+-- and `System.Socket.Family.Inet6.Inet6` (IPv6). class Storable (SocketAddress f) => Family f where -- | The number designating this `Family` on the specific platform. This -- method is only exported for implementing extension libraries.