SYNOPSIS
#include <sys/types.h>
#include <sys/socket.h>
int accept(int s, struct sockaddr *addr, socklen_t *addrlen);
DESCRIPTION
The
The parameter s is a socket that has been created with
The
You can select a socket for the purpose of an
PARAMETERS
- s
-
Specifies the descriptor of the socket that is waiting for a connection after a listen.
- addr
-
This is a result parameter that is filled in with the address of the connecting entity (as known to the communications layer). The domain in which the communication is occurring determines the exact format of addr. If addr is NULL, no information about the remote address of the accepted socket is returned.
- addrlen
-
This is a value-result parameter. Initially, addrlen contains the amount of space that addr points to. When returned, it contains the actual length (in bytes) of the address returned. If addrlen is NULL, no information about the remote address of the accepted socket is returned.
RETURN VALUES
If successful,
- EBADF
-
s is not a valid descriptor.
- EFAULT
-
addr or addrlen is an invalid pointer, or addrlen is too small (less than the size of a struct sockaddr).
- EINTR
-
A signal interrupted the call.
- EINVAL
-
listen() was not invoked prior toaccept() . - EMFILE
-
Cannot open a file: OPEN_MAX file descriptors are currently open in the calling process.
- ENETDOWN
-
The network subsystem has failed.
- ENOBUFS
-
No buffer space is available.
- ENOTSOCK
-
The descriptor is not a socket.
- EOPNOTSUPP
-
The referenced socket is not a type that supports connection-oriented service.
- EWOULDBLOCK
-
The socket is marked as non-blocking and no connections are present to be accepted.
CONFORMANCE
UNIX 98, with exceptions.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
The NuTCRACKER Platform supports all the address families that WinSock 2.0 supports.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.4 Documentation Build 39.