Platform SDK: Windows Sockets

Connections Using Accept/WSAAccept/WSPAccept

This section describes various data connections for accept functions.

Immediate Accept with No Optional or Access Data

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 
);
Parameter Description
addr Pointer to a SOCKADDR_DN structure that 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 that contains concatenated OPTDATA_DN and ACCESSDATA_DN structures. If lpCallerData is set to NULL, no additional data will be read from the caller. If either the OPTDATA_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 can be returned by the server. The lpCalleeData pointer should point to a buffer containing the OPTDATA_DN structure. If lpCalleeData is set to NULL, no optional data can be read from the server.