UDP(7P) — Silicon Graphics
NAME
udp − Internet User Datagram Protocol
SYNOPSIS
#include <sys/socket.h>
#include <netinet/in.h>
struct sockproto proto = { PF_INET, IPPROTO_UDP };
socket(SOCK_DGRAM, &proto, address, options);
struct sockaddr_in *address; int options;
DESCRIPTION
UDP is a simple, unreliable datagram protocol that supports the SOCK_DGRAM abstraction for the Internet protocol family. UDP sockets are connectionless and normally use send(3N) and receive(3N) calls. The destination for future packets can be set via a connect(3N) call. Then read(2) and write(2) system calls can be used.
UDP address formats are identical to those used for TCP. UDP provides a port identifier in addition to the normal Internet address format. UDP port space is not part of TCP port space (that is, a UDP port cannot be "connected" to a TCP port).
DIAGNOSTICS
EISCONN
Trying to establish a connection on an already-connected socket, or trying to send a datagram with a destination address and the socket is already connected
ENOTCONN
Trying to send a datagram, but no destination address is specified and the socket hasn’t been connected
ENOBUFS
The system does not have enough memory for an internal data structure
EADDRINUSE
Attempted to create a socket with a port that is allocated
EADDRNOTAVAIL
Attempted to create a socket with an invalid network interface
SEE ALSO
Version 2.4 — May 08, 1986