Idris2Doc : Network.Socket.Data

Network.Socket.Data

Low-Level C Sockets bindings for Idris. Used by higher-level, cleverer things.
Types used by Network.Socket.Raw and Network.Socket.

Original (C) SimonJF, MIT Licensed, 2014
Modified (C) The Idris Community, 2015, 2016, 2019
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
recordSocket : 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
dataSocketAddress : 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

dataSocketFamily : 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
dataSocketType : 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
interfaceToCode : Type -> Type
Parameters: a
Methods:
toCode : a -> Int

Implementations:
ToCodeSocketFamily
ToCodeSocketType
recordUDPAddrInfo : Type
Totality: total
Constructor: 
MkUDPAddrInfo : SocketAddress -> Port -> UDPAddrInfo

Projections:
.remote_addr : UDPAddrInfo -> SocketAddress
.remote_port : UDPAddrInfo -> Port
recordUDPRecvData : 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 : HasIOio => ioSocketError
getSocketFamily : Int -> MaybeSocketFamily
nullPtr : HasIOio => AnyPtr -> ioBool
parseIPv4 : String -> SocketAddress
  Parses a textual representation of an IPv4 address into a SocketAddress

toCode : ToCodea => a -> Int