stdio-0.1.0.0: A simple and high performance IO toolkit for Haskell

Copyright(c) Winterland 2018
LicenseBSD
Maintainerdrkoster@qq.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Std.IO.SockAddr

Contents

Description

This module provides necessary types and constant for low level socket operation.

Synopsis

name to address

data SockAddr Source #

IPv4 or IPv6 socket address, i.e. the sockaddr_in or sockaddr_in6 struct.

Instances
Eq SockAddr Source # 
Instance details

Defined in Std.IO.SockAddr

Ord SockAddr Source # 
Instance details

Defined in Std.IO.SockAddr

Show SockAddr Source # 
Instance details

Defined in Std.IO.SockAddr

IPv4 address

data InetAddr Source #

Independent of endianness. For example 127.0.0.1 is stored as (127, 0, 0, 1).

For direct manipulation prefer inetAddrToTuple and tupleToInetAddr.

Instances
Eq InetAddr Source # 
Instance details

Defined in Std.IO.SockAddr

Ord InetAddr Source # 
Instance details

Defined in Std.IO.SockAddr

Show InetAddr Source # 
Instance details

Defined in Std.IO.SockAddr

Storable InetAddr Source # 
Instance details

Defined in Std.IO.SockAddr

inetBroadcast :: InetAddr Source #

255.255.255.255

inetNone :: InetAddr Source #

255.255.255.255

inetAddrToTuple :: InetAddr -> (Word8, Word8, Word8, Word8) Source #

Converts HostAddress to representation-independent IPv4 quadruple. For example for 127.0.0.1 the function will return (127, 0, 0, 1) regardless of host endianness.

tupleToInetAddr :: (Word8, Word8, Word8, Word8) -> InetAddr Source #

Converts IPv4 quadruple to HostAddress.

IPv6 address

data Inet6Addr Source #

Independent of endianness. For example ::1 is stored as (0, 0, 0, 1).

For direct manipulation prefer inet6AddrToTuple and tupleToInet6Addr.

port numbber

data PortNumber Source #

Use the Num instance (i.e. use a literal or fromIntegral) to create a PortNumber value with the correct network-byte-ordering.

>>> 1 :: PortNumber
1
>>> read "1" :: PortNumber
1
Instances
Enum PortNumber Source # 
Instance details

Defined in Std.IO.SockAddr

Eq PortNumber Source # 
Instance details

Defined in Std.IO.SockAddr

Integral PortNumber Source # 
Instance details

Defined in Std.IO.SockAddr

Num PortNumber Source # 
Instance details

Defined in Std.IO.SockAddr

Ord PortNumber Source # 
Instance details

Defined in Std.IO.SockAddr

Read PortNumber Source # 
Instance details

Defined in Std.IO.SockAddr

Real PortNumber Source # 
Instance details

Defined in Std.IO.SockAddr

Show PortNumber Source # 
Instance details

Defined in Std.IO.SockAddr

Storable PortNumber Source # 
Instance details

Defined in Std.IO.SockAddr

family, type, protocol

newtype SocketFamily Source #

Constructors

SocketFamily CInt 

pattern AF_UNSPEC :: SocketFamily Source #

unspecified

pattern AF_INET :: SocketFamily Source #

internetwork: UDP, TCP, etc

pattern AF_INET6 :: SocketFamily Source #

Internet Protocol version 6

newtype SocketProtocol Source #

Constructors

SocketProtocol CInt 
Instances
Eq SocketProtocol Source # 
Instance details

Defined in Std.IO.SockAddr

Ord SocketProtocol Source # 
Instance details

Defined in Std.IO.SockAddr

Read SocketProtocol Source # 
Instance details

Defined in Std.IO.SockAddr

Show SocketProtocol Source # 
Instance details

Defined in Std.IO.SockAddr

Storable SocketProtocol Source # 
Instance details

Defined in Std.IO.SockAddr