Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ unix(7P) — HP-UX 9.05

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getsockopt(2)

socket(2)

UNIX(7P)

NAME

UNIX − Local communication domain protocol

SYNOPSIS

#include <sys/types.h>
#include <sys/un.h>

DESCRIPTION

The local communication domain protocol, commonly referred to in the industry as the Unix domain protocol, utilizes the path name address format and the AF_UNIX address family.  This protocol can be used as an alternative to the internet protocol family ( TCP/IP or UDP/IP) for communication between processes executing on the same node.  It has a significant throughput advantage when compared with local IP loopback, due primarily to its much lower code execution overhead.  Data is looped back at the protocol layer ( OSI Level 4), rather than at the driver layer ( OSI Level 2). 

The HP-UX implementation of the local communication domain protocol supports all of the BSD networking system calls except for getpeername() and getsockname() (see getpeername(2) and getsockname(2)). In addition, the MSG_OOB flag to recv() is not supported (see recv(2)).

Addressing

AF_UNIX socket addresses are path names.  They are limited to 92 bytes in length, including a terminating null byte.  Calls to bind() to an AF_UNIX socket utilize an addressing structure called struct sockaddr_un (see bind(2)). Pointers to this structure should be used in all AF_UNIX socket system calls wherever they ask for a pointer to a struct sockaddr. 

The include file <sys/un.h> defines this addressing structure. 

There are two fields of interest within this structure.  The first is sun_family, which must be set to AF_UNIX.  The next is sun_path, which is the null-terminated character string specifying the path name of the file associated with the socket (for example, /tmp/mysocket). 

Only the passive (listening) socket must bind to an address.  The active socket connects to that address, but it does not need an address of its own. 

For additional information on using AF_UNIX sockets for interprocess communication, refer to the BSD IPC programmer’s manual. 

Socket Buffer Size

The maximum buffer size for stream and datagram sockets is 58254 bytes. For stream sockets, the default send and receive buffer size is 8192 bytes. The default outbound and inbound message size for datagram sockets is 9216 bytes. The send and receive buffer sizes can be altered by using the SO_SNDBUF and SO_RCVBUF options of the setsockopt() system call.  Refer to getsockopt(2) for details.

AUTHOR

UNIX was developed by the University of California, Berkeley. 

SEE ALSO

getsockopt(2), socket(2). 

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026