Effect Udppub
Source:effect(pub) Udp
.udp-bind ( Str AnyInt → (Result AnyUInt Str) )
.udp-connect ( Str AnyInt AnyUInt → (Result AnyUInt Str) )
.udp-send-to ( Bytes Str AnyInt AnyUInt → (Result AnyUInt Str) )
.udp-send ( Bytes AnyUInt → (Result AnyUInt Str) )
.udp-recv-from ( AnyUInt AnyUInt → (Result (Pair Bytes (Pair Str AnyInt)) Str) )
.udp-recv ( AnyUInt AnyUInt → (Result Bytes Str) )
.udp-close ( AnyUInt → )
.udp-local-addr ( AnyUInt → (Pair Str AnyInt) )
.udp-set-broadcast ( Bool AnyUInt → (Result Unit Str) )
Description
UDP datagram effect. Socket handles are carried as AnyUInt fds; SocketAddr is represented as a (Pair Str AnyInt) of (host, port).
Operations
.udp-bind ( Str AnyInt → (Result AnyUInt Str) )
.udp-bind ( Str AnyInt → (Result AnyUInt Str) )
Bind a UDP socket to the given host:port. Returns a socket handle.
.udp-connect ( Str AnyInt AnyUInt → (Result AnyUInt Str) )
.udp-connect ( Str AnyInt AnyUInt → (Result AnyUInt Str) )
Pin the socket's default peer to the given host:port.
.udp-send-to ( Bytes Str AnyInt AnyUInt → (Result AnyUInt Str) )
.udp-send-to ( Bytes Str AnyInt AnyUInt → (Result AnyUInt Str) )
Send a single datagram to the given host:port via the socket.
.udp-recv-from ( AnyUInt AnyUInt → (Result (Pair Bytes (Pair Str AnyInt)) Str) )
.udp-recv-from ( AnyUInt AnyUInt → (Result (Pair Bytes (Pair Str AnyInt)) Str) )
Receive a datagram (bytes + sender host:port) up to max bytes.