Connections Using Accept/WSAAccept/ WSPAccept

This section describes various data connections for accept functions.

Immediate Accept with no optional or access data

In order to accept a connection on a DECnet socket, the parameter addr should point to a sockaddr_dn structure.

#include <ws2dnet.h>

SOCKET WSAAPI accept ( SOCKET s, struct sockaddr_dn FAR * addr, int FAR * addrlen );

SOCKET WSAAPI WSAAccept ( SOCKET s, struct sockaddr_dn FAR * addr, int FAR * addrlen, LPCONDITIONPROC lpfnCondition, DWORD dwCallbackData );

SOCKET WSPAPI WSPAccept( SOCKET s, struct sockaddr_dn FAR * addr, int FAR * addrlen, LPCONDITIONPROC lpfnCondition, DWORD dwCallbackData, 
int FAR * lpErrno );
 
addr A pointer to a sockaddr_dn structure which receives the address of the connecting entity, as known to the communications layer.

Deferred accept with optional and access data

DECnet sockets support both immediate and deferred accepts. It also supports the exchange of up to 16 bytes of optional data on accept and connect. It also supports the receipt of DECnet access control information by the server from the client on a connect request.

#include <ws2dnet.h>

SOCKET WSAAPI WSAAccept ( SOCKET s, struct sockaddr_dn FAR * addr, int FAR * addrlen, LPCONDITIONPROC lpfnCondition, DWORD dwCallbackData );

SOCKET WSPAPI WSPAccept( SOCKET s, struct sockaddr_dn FAR * addr, int FAR * addrlen, LPCONDITIONPROC lpfnCondition, DWORD dwCallbackData, 
int FAR * lpErrno );
 

DECnet optional data is passed in an optdata_dn structure. Access control data is passed in an accessdata_dn structure.

In the CALLBACK function, the lpCallerData should point to a calldata_dn structure which contains concatenated opdata_dn and accessdata_dn structures. If lpCallerData is set to NULL, no additional data will be read from the caller. If either the opdata_dn.opt_optl or the accessdata_dn.acc_userl are set to zero, that portion of the structure will be ignored.

The accept only reads accessdata_dn, it does not write it, so only optdata_dn will be returned by the server. The lpCalleeData pointer should point to a buffer containing the opdata_dn structure. If lpCalleeData is set to NULL no optional data will be read from the server.