- BACKLOG : Int
Backlog used within listen() call -- number of incoming calls
- ByteLength : Type
-
- EAGAIN : Int
-
- Port : Type
-
- ProtocolNumber : Type
Protocol Number.
Generally good enough to just set it to 0.
- ResultCode : Type
-
- record Socket : Type
The metadata about a socket
Totality: total
Constructor: - MkSocket : SocketDescriptor -> SocketFamily -> SocketType -> ProtocolNumber -> Socket
Projections:
- .descriptor : Socket -> SocketDescriptor
- .family : Socket -> SocketFamily
- .protocolNumber : Socket -> ProtocolNumber
- .socketType : Socket -> SocketType
- data SocketAddress : Type
Network Addresses
Totality: total
Constructors:
- IPv4Addr : Int -> Int -> Int -> Int -> SocketAddress
- IPv6Addr : SocketAddress
Not implemented (yet)
- Hostname : String -> SocketAddress
- InvalidAddress : SocketAddress
Used when there's a parse error
- SocketDescriptor : Type
SocketDescriptor: Native C Socket Descriptor
- SocketError : Type
SocketError: Error thrown by a socket operation
- data SocketFamily : Type
Socket Families
The ones that people might actually use. We're not going to need US
Government proprietary ones.
Totality: total
Constructors:
- AF_UNSPEC : SocketFamily
Unspecified
- AF_UNIX : SocketFamily
Unix type sockets
- AF_INET : SocketFamily
IP / UDP etc. IPv4
- AF_INET6 : SocketFamily
IP / UDP etc. IPv6
- data SocketType : Type
Socket Types.
Totality: total
Constructors:
- NotASocket : SocketType
Not a socket, used in certain operations
- Stream : SocketType
TCP
- Datagram : SocketType
UDP
- RawSocket : SocketType
Raw sockets
- interface ToCode : Type -> Type
- Parameters: a
Methods:
- toCode : a -> Int
Implementations:
- ToCode SocketFamily
- ToCode SocketType
- record UDPAddrInfo : Type
- Totality: total
Constructor: - MkUDPAddrInfo : SocketAddress -> Port -> UDPAddrInfo
Projections:
- .remote_addr : UDPAddrInfo -> SocketAddress
- .remote_port : UDPAddrInfo -> Port
- record UDPRecvData : Type
- Totality: total
Constructor: - MkUDPRecvData : SocketAddress -> Port -> String -> Int -> UDPRecvData
Projections:
- .data_len : UDPRecvData -> Int
- .recv_data : UDPRecvData -> String
- .remote_addr : UDPRecvData -> SocketAddress
- .remote_port : UDPRecvData -> Port
- getErrno : HasIO io => io SocketError
-
- getSocketFamily : Int -> Maybe SocketFamily
-
- nullPtr : HasIO io => AnyPtr -> io Bool
-
- parseIPv4 : String -> SocketAddress
Parses a textual representation of an IPv4 address into a SocketAddress
- toCode : ToCode a => a -> Int
-