socket(2dn)
NAME
socket − create a socket and return a descriptor
SYNTAX
#include <sys/types.h>
#include <sys/socket.h>
#include <netdnet/dn.h>
s = socket (af,type,protocol)
int s,af,type,protocol;
ARGUMENTS
Input Arguments
af Specifies the address format for the DECnet communication domain as AF_DECnet.
type Specifies the socket type. The DECnet domain supports the following socket types:
SOCK_STREAM
Stream sockets provide bidirectional, reliable, sequenced, and unduplicated byte streams.
SOCK_SEQPACKET
Sequenced packet sockets provide bidirectional, reliable, sequenced data flow while preserving record boundaries in data.
protocol Specifies the protocol to be used with the socket. Valid protocols are 0 (default) and DNPROTO_NSP (DECnet protocol).
If you specify the socket type SOCK_SEQPACKET, you must set the protocol to zero.
Return Argument
s Value for the socket descriptor.
DESCRIPTION
The socket call creates a socket and returns a socket descriptor. A socket is an addressable endpoint of communication. A program uses the socket to transmit and receive data to and from a similar socket in another program. Subsequent calls on a particular socket reference that socket’s descriptor.
RETURN VALUE
If the call completes successfully, a socket descriptor value is returned. This descriptor is used for subsequent system calls on this particular socket. If an error occurs, a value of −1 is returned. Additional error detail is contained in the external variable errno.
DIAGNOSTICS
[EAFNOSUPPORT] The specified address family is not supported in this version of the system.
[ESOCKTNOSUPPORT]
The specified socket type is not supported in this address family.
[EPROTONOSUPPORT]
The specified protocol is not supported.
[ENFILE] The per-process descriptor table is full.
[EMFILE] Too many open files.
[ENOBUFS] No buffer space is available. The socket cannot be created.