UdpSocket
bind
defn
(Fn [(Ref String a), Int] (Result UdpSocket String))
(bind addr port)
binds a UDP socket to the given address and port.
Returns (Result UdpSocket String).
recv-from
defn
(Fn [(Ref UdpSocket a)] (Result (Pair (Array Byte) String) String))
(recv-from sock)
receives data and the sender's address.
Returns (Result (Pair (Array Byte) String) String) where the string is
the sender's address in ip:port format.
send-to
defn
(Fn [(Ref UdpSocket a), (Ref String b), Int, (Ref (Array Byte) c)] (Result Int String))
(send-to sock host port data)
sends data to a remote address. Returns bytes sent or an error.