udp_socket |
An os_udp_socket
provides unreliable, connectionless communication. A datagram is a single packet
of information that is sent from one socket to another. The sender must know the
address of the destination socket. Because datagram communication is unreliable,
there is no guarantee that the receiver will actually get the datagram.
Although datagram communication
is connectionless, a UDP socket can be connected to a destination address. If
you call connect_to() in a UDP socket, all
datagrams that are subsequently sent using send()
are automatically routed to the connected address. Each use of connect_to()
overrides the previous connection address.
enum os_udp_socket::bind_t
{
bound,
unbound
};
os_udp_socket::bound (default), constructs a
UDP socket with a unique socket address; otherwise, constructs an unbound
socket. Throws: os_network_toolkit_error
Throws: os_network_toolkit_error
Throws: os_network_toolkit_error
true if broadcasting is enabled. Throws: os_network_toolkit_error
Throws: os_network_toolkit_error
224.0.0.0"
through "239.255.255.255" are
multicast addresses. The local interface local_interface
(default os_ip_address()
which is INADDR_ANY) is used as the interface
address for incoming multicast datagrams. The default local_interface
causes the kernel to choose
the interface to join on. More than one join is allowed but each join must
specify a different group address or a same group address but a different local_interface
(for multihomed host).Throws: os_network_toolkit_error
join_multi_group() function.Throws: os_network_toolkit_error
Throws: os_network_toolkit_error
os_ip_address
object then the local address is INADDR_ANY and
the kernel will use the unicast routing table to select the outgoing
interface.Throws: os_network_toolkit_error
false, multicast loop back is disabled.Throws: os_network_toolkit_error
Throws: os_network_toolkit_error
Throws: os_network_toolkit_error
Throws: os_network_toolkit_error
Throws: os_network_toolkit_error
-1
on error. [not MTSAFE on Solaris]Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved - For use by licensed users only.