Xaccept(), Xaccept4() - accept/reject jobs sent to a destination.
More...
#include "Xsocket.h"
|
| int | Xaccept (int sockfd, struct sockaddr *addr, socklen_t *addrlen) |
| | accept a connection on an Xsocket More...
|
| |
| int | Xaccept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) |
| | accept a connection on an Xsocket More...
|
| |
| int Xaccept |
( |
int |
sockfd, |
|
|
struct sockaddr * |
addr, |
|
|
socklen_t * |
addrlen |
|
) |
| |
The Xaccept system call is is only valid with Xsockets created with the SOCK_STREAM transport type. It accepts the first available connection request for the listening socket, sockfd, creates a new connected socket, and returns a new Xsocket descriptor referring to that socket. The newly created socket is not in the listening state. The original socket sockfd is unaffected by this call.
- Parameters
-
| sockfd | an Xsocket previously created with the SOCK_STREAM type, and bound to a local DAG with Xbind() |
| addr | if non-NULL, points to a block of memory that will contain the address of the peer on return |
| addrlen | on entry, contains the size of addr, on exit contains the actual size of the address. addr will be truncated, if the size passed in is smaller than the actual size. |
- Note
- See the man page for the standard accept() call for more details.
- Returns
- a non-negative integer that is the new Xsocket id
-
-1 on error with errno set to an error compatible with those returned by the standard accept call.
| int Xaccept4 |
( |
int |
sockfd, |
|
|
struct sockaddr * |
addr, |
|
|
socklen_t * |
addrlen, |
|
|
int |
flags |
|
) |
| |
The Xaccept4 system call is is only valid with Xsockets created with the SOCK_STREAM transport type. It accepts the first available connection request for the listening socket, sockfd, creates a new connected socket, and returns a new Xsocket descriptor referring to that socket. The newly created socket is not in the listening state. The original socket sockfd is unaffected by this call.
- Parameters
-
| sockfd | an Xsocket previously created with the SOCK_STREAM type, and bound to a local DAG with Xbind() |
| addr | if non-NULL, points to a block of memory that will contain the address of the peer on return |
| addrlen | on entry, contains the size of addr, on exit contains the actual size of the address. addr will be truncated, if the size passed in is smaller than the actual size. |
| flags | if SOCK_NONBLOCK is set, the new socket will be non-blocking. An error will be returned if any other bits in the flags are set. |
- Note
- See the man page for the standard accept() call for more details.
- Returns
- a non-negative integer that is the new Xsocket id
-
-1 on error with errno set to an error compatible with those returned by the standard accept call.