@@ -108,32 +108,17 @@ EAGAIN = 11
109-- TODO: Expand to non-string payloads
109-- TODO: Expand to non-string payloads
110record UDPRecvData where
110record UDPRecvData where
111+ constructor MkUDPRecvData
111 remote_addr : SocketAddress
112 remote_addr : SocketAddress
112 remote_port : Port
113 remote_port : Port
113 recv_data : String
114 recv_data : String
114 data_len : Int
115 data_len : Int
117−record UDPRecvData : Type where
119− (remote_addr : SocketAddress) ->
120− (remote_port : Port) ->
121− (recv_data : String) ->
126record UDPAddrInfo where
117record UDPAddrInfo where
118+ constructor MkUDPAddrInfo
127 remote_addr : SocketAddress
119 remote_addr : SocketAddress
128 remote_port : Port
120 remote_port : Port
131−record UDPAddrInfo : Type where
133− (remote_addr : SocketAddress) ->
134− (remote_port : Port) ->
137||| Frees a given pointer
122||| Frees a given pointer
139sock_free : BufPtr -> IO ()
124sock_free : BufPtr -> IO ()
@@ -152,19 +137,12 @@ sock_alloc bl = map BPtr $ foreign FFI_C "idrnet_malloc" (Int -> IO Ptr) bl
153||| The metadata about a socket
138||| The metadata about a socket
154record Socket where
139record Socket where
140+ constructor MkSocket
155 descriptor : SocketDescriptor
141 descriptor : SocketDescriptor
156 family : SocketFamily
142 family : SocketFamily
157 socketType : SocketType
143 socketType : SocketType
158 protocalNumber : ProtocolNumber
144 protocalNumber : ProtocolNumber
161−record Socket : Type where
162− MkSocket : (descriptor : SocketDescriptor) ->
163− (family : SocketFamily) ->
164− (socketType : SocketType) ->
165− (protocolNumber : ProtocolNumber) ->
168||| Get the C error number
146||| Get the C error number
169getErrno : IO Int
147getErrno : IO Int
170getErrno = foreign FFI_C "idrnet_errno" (IO Int)
148getErrno = foreign FFI_C "idrnet_errno" (IO Int)