socket-0.6.0.1: An extensible socket library.

Copyright(c) Lars Petersen 2015
LicenseMIT
Maintainerinfo@lars-petersen.net
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

System.Socket.Family.Inet

Contents

Description

 

Synopsis

Inet

data Inet Source

Instances

Family Inet Source 
HasNameInfo Inet Source 
HasAddressInfo Inet Source 
Eq (SocketAddress Inet) Source 
Show (SocketAddress Inet) Source 
Storable (SocketAddress Inet) Source 
data SocketAddress Inet = SocketAddressInet {} Source

An IPv4 socket address.

The socket address contains a port number that may be used by transport protocols like TCP.

SocketAddressInet inetLoopback 8080

InetAddress

data InetAddress Source

To avoid errors with endianess it was decided to keep this type abstract.

Hint: Use the Storable instance if you really need to access. It exposes it exactly as found within an IP packet (big endian if you insist on interpreting it as a number).

Another hint: Use getAddressInfo for parsing and suppress nameserver lookups:

> getAddressInfo (Just "127.0.0.1") Nothing aiNumericHost :: IO [AddressInfo Inet Stream TCP]
[AddressInfo {addressInfoFlags = AddressInfoFlags 4, socketAddress = SocketAddressInet {inetAddress = InetAddress 127.0.0.1, inetPort = InetPort 0}, canonicalName = Nothing}]

InetPort

SocketAddress Inet

data family SocketAddress f Source

The SocketAddress type is a data family. This allows to provide different data constructors depending on the socket family wihtout knowing all of them in advance or the need to patch this core library.

SocketAddressInet  inetLoopback  8080     :: SocketAddress Inet
SocketAddressInet6 inet6Loopback 8080 0 0 :: SocketAddress Inet6

Instances

Eq (SocketAddress Inet) 
Eq (SocketAddress Inet6) 
Show (SocketAddress Inet) 
Show (SocketAddress Inet6) 
Storable (SocketAddress Inet) 
Storable (SocketAddress Inet6) 
data SocketAddress Inet = SocketAddressInet {} Source

An IPv4 socket address.

The socket address contains a port number that may be used by transport protocols like TCP.

SocketAddressInet inetLoopback 8080
data SocketAddress Inet6 = SocketAddressInet6 {} Source

An IPv6 socket address.

The socket address contains a port number that may be used by transport protocols like TCP.

SocketAddressInet6 inet6Loopback 8080 0 0

Special Addresses

inetAllHostsGroup

inetAny

inetBroadcast

inetBroadcast :: InetAddress Source

255.255.255.255

inetLoopback

inetMaxLocalGroup

inetNone

inetNone :: InetAddress Source

255.255.255.255

inetUnspecificGroup