Raccept()
The Raccept() socket call accepts a connection request from a SOCKS server.
Syntax
#include <types.h>
#include <sys\socket.h>
#include <netinet\in.h>
int Raccept(s, name, namelen)
int s;
sockaddr *name;
int *namelen;
Parameters
s
name
Pointer to a sockaddr structure that contains
the socket address of the connection client when the Raccept() call returns.
The format of name is determined by the communications domain where
the client resides. This parameter can be NULL if the caller is not interested
in the client address.
namelen
Must
initially point to an integer that contains the size in bytes of the storage
pointed to by name. On return, that integer contains the size of
the data returned in the storage pointed to by name. If name is
NULL, namelen is ignored and can be NULL.
Description
This call is used to accept the first pending connection on the socket.
If the socket was bound through a SOCKS server using Rbind(), it will block
until the SOCKS server accepts a connection on its behalf. If the socket
was not bound through a SOCKS server, this call is equivalent to accept().
Return Values
A non-negative socket descriptor indicates success; the value -1 indicates
an error. You can get the specific error code by calling sock_errno() or
psock_errno().
Error Code
SOCENOTSOCK
Thesparameterisnotavalidsocketdescriptor
.
SOCEFAULT
Usingnameandnamelenwouldresultinanattempttocopytheaddressintoaportionofthecalleraddressspaceintowhichinformationcannotbewritten
.
SOCEINTR
SOCEINVAL
Listen ( )wasnotcalledforsockets
.
SOCENOBUFS
Insufficientbufferspaceavailabletocreatethenewsocket
.
SOCEOPNOTSUPP
Thesparameterisnotconnection
- oriented .
SOCEWOULDBLOCK
Thesparameterisinnonblockingmodeandnoconnectionsareonthequeue
.
SOCECONNABORTED
Thesoftwarecausedaconnectionclose
.
Related Calls
[Back: putshort()]
[Next: Rbind()]