[APE Index] [APE Hierarchy] [Headers]
Unreliable Datagram Protocol sockets. More...
#include <socket.h>
Inherits: Socket
UDP sockets implement the TCP SOCK_DGRAM UDP protocol. They can be used to pass unverified messages between hosts, or to broadcast a specific message to an entire subnet. Please note that Streaming of realtime data commonly use UDPSimplex or UDPDuplex rather than UDPSocket.
[public]
Create an unbound UDP socket, mostly for internal use.
[public]
Create a UDP socket and bind it to a specific interface and port address so that other UDP sockets on remote machines (or the same host) may find and send UDP messages to it. On failure to bind, an exception is thrown.
port | number to bind this socket to. |
bind | address to bind this socket to. |
[public]
Create a UDP socket that is connected to another UDP socket. While a UDP socket "connection" has no tangible resource unlike with TCP, it does prevent the socket from accepting UDP packets from any socket other than the one that it is connected to.
port | number to connect the local socket to. |
host | address to connect the local socket to. |
[public]
Bind a UDP socket for use in sending subnet broadcast messages. This enables the SO_BROADCAST attribute of the socket.
cast | address of subnet to broadcast messages on. |
port | number to receive messages from other broadcasters. |
[public]
Write a UDP message of arbitrary bytes. Each write genorates a unique UDP message of the specified length, rather than simply writing data to a stream. Hence, if one is writing a message composed of a header and data segment, all of which are meant to be sent as one UDP message, then one must do so in a single Write operation or through the use of writev.
addr | pointer to UDP message data. |
port | number of destination socket. |
host | internet address of destination socket. |
len | number of bytes in UDP message. |
| Kdoc |