*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> udp (7)              
Title
Content
Arch
Section
 

udp(7)

Contents


NAME    [Toc]    [Back]

       udp - Internet user datagram protocol (UDP)

SYNOPSIS    [Toc]    [Back]

       #include <sys/socket.h> #include <netinet/in.h>


       The following is the socket call for AF_INET sockets:

       s = socket(AF_INET, SOCK_DGRAM, 0);

       The following is the socket call for AF_INET6 sockets:

       s = socket(AF_INET6, SOCK_DGRAM, 0);

DESCRIPTION    [Toc]    [Back]

       UDP is a simple, unreliable datagram protocol that is used
       to support the SOCK_DGRAM  abstraction  for  the  Internet
       Protocol  family.  UDP sockets are connectionless, and are
       normally used with the sendto() and recvfrom()  functions,
       though  the connect() function may also be used to fix the
       destination for future packets, in which case  the  recv()
       or read() and send() or write() functions may be used.

       UDP  address  formats  are identical to those used by TCP.
       In particular, UDP provides a port identifier in  addition
       to  the normal Internet address format.  Note that the UDP
       port space is separate from the TCP port space (that is, a
       UDP  port may not be "connected" to a TCP port).  In addition,
 IPv4 broadcast packets may  be  sent  (assuming  the
       underlying  network  supports  this)  by  using a reserved
       "broadcast address"; this  address  is  network  interface
       dependent.

                                  Note

       There is no broadcast address in IPv6.

       Options  at  the  IP transport level may be used with UDP;
       see the ip(7) reference page.

ERRORS    [Toc]    [Back]

       If a socket operation fails, errno may be set  to  one  of
       the  following  values:  An  attempt  was made to create a
       socket with a port that has already  been  allocated.   An
       attempt was made to create a socket with a network address
       for which no network  interface  exists.   The  socket  is
       already  connected.   This  error  occurs  when  trying to
       establish connection on a socket or when trying to send  a
       datagram with the destination address specified.  The system
 ran out of memory for an internal data structure.  The
       destination  address  of a datagram was not specified, and
       the socket has not been connected.








SEE ALSO    [Toc]    [Back]

      
      
       Functions: getsockopt(2), recv(2), send(2), socket(2)

       Files: netintro(7), inet(7), ip(7)



                                                           udp(7)
[ Back ]
 Similar pages
Name OS Title
udp OpenBSD Internet User Datagram Protocol
udp IRIX Internet User Datagram Protocol
udp FreeBSD Internet User Datagram Protocol
idp OpenBSD Xerox Internet Datagram Protocol
udp Linux User Datagram Protocol for IPv4
ip FreeBSD Internet Protocol
ip OpenBSD Internet Protocol
ip IRIX Internet Protocol
inet IRIX Internet protocol family
inet FreeBSD Internet protocol family
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service