Documentation

Std.Internal.UV.UDP

@[extern lean_uv_udp_new]

Creates a new UDP socket.

@[extern lean_uv_udp_bind]

Binds an UDP socket to a specific address. Address reuse is enabled to allow rebinding the same address.

@[extern lean_uv_udp_connect]

Associates the UDP socket with the given address and port, so every message sent by this socket is automatically sent to that destination.

@[extern lean_uv_udp_send]

Sends data through an UDP socket. The addr parameter specifies the destination address. If addr is none, the data is sent to the default peer address set by connect.

@[extern lean_uv_udp_recv]

Receives data from an UDP socket. size is for the maximum bytes to receive. The promise resolves when some data is available or an error occurs.

@[extern lean_uv_udp_getpeername]

Receives data from an UDP socket. size is for the maximum bytes to receive. The promise resolves when some data is available or an error occurs. If the socket has not been previously bound with bind, it is automatically bound to 0.0.0.0 (all interfaces) with a random port.

@[extern lean_uv_udp_getsockname]

Gets the local address of a bound UDP socket.

@[extern lean_uv_udp_set_broadcast]

Enables or disables broadcasting on a UDP socket.

@[extern lean_uv_udp_set_multicast_loop]

Enables or disables multicast loopback for a UDP socket.

@[extern lean_uv_udp_set_multicast_ttl]

Sets the time-to-live (TTL) value for multicast packets.

@[extern lean_uv_udp_set_membership]
opaque Std.Internal.UV.UDP.Socket.setMembership (socket : Socket) (multicastAddr : Net.IPAddr) (interfaceAddr : Option Net.IPAddr) (membership : UInt8) :

Sets the membership for joining or leaving a multicast group. If interfaceAddr is none, the default network interface is used.

@[extern lean_uv_udp_set_multicast_interface]

Sets the multicast interface for sending packets.

@[extern lean_uv_udp_set_ttl]

Sets the TTL value for outgoing packets.