Platform SDK: Windows Sockets

Connections Using Connect/WSAConnect/WSPConnect

This section provides connection information using Connect functions.

Connect with no Optional or Access Data

In order to establish a connection to a DECnet peer, the parameter name should point to a SOCKADDR_DN structure.

#include <ws2dnet.h>

int WSAAPI connect( 
  SOCKET s, 
  const struct sockaddr_dn FAR * name, 
  int namelen 
);

int WSAAPI WSAConnect(
  SOCKET s, 
  const struct sockaddr_dn FAR * name, 
  int namelen, 
  LPWSABUF lpCallerData, 
  LPWSABUF lpCalleeData, 
  GROUP g, 
  LPQOS lpSQOS, 
  LPQOS lpGQOS 
);

int WSPAPI WSPConnect(
  SOCKET s, 
  const struct sockaddr_dn FAR * name, 
  int namelen, 
  LPWSABUF lpCallerData, 
  LPWSABUF lpCalleeData, 
  LPQOS lpSQOS, 
  LPQOS lpGQOS, 
  int FAR * lpErrno 
);
Parameter Description
name Pointer to a SOCKADDR_DN structure that contains the DECnet address and object to which the socket is to be connected.

Optional and Access Data on Connect

DECnet sockets support the exchange of up to 16 bytes of optional data on a WSAConnect. It also supports the sending of DECnet access control information from the client to the server on a connect request.

#include <ws2dnet.h>

int WSAAPI WSAConnect(
  SOCKET s,
  const struct sockaddr_dn FAR * name, 
  int namelen,
  LPWSABUF lpCallerData,
  LPWSABUF lpCalleeData, 
  GROUP g,
  LPQOS lpSQOS,
  LPQOS lpGQOS 
);

int WSPAPI WSPConnect(
  SOCKET s,
  const struct sockaddr_dn FAR * name,
  int namelen,
  LPWSABUF lpCallerData,
  LPWSABUF lpCalleeData,
  LPQOS lpSQOS,LPQOS lpGQOS,
  int FAR * lpErrno 
);
Parameter Description
lpCallerData Pointer to the user data that is to be transferred from the client to the server during connection establishment.
lpCalleeData Pointer to the optional data that is to be transferred back from the server during connection establishment.

DECnet optional data is passed in an OPTDATA_DN structure. Access control data is passed in an ACCESSDATA_DN structure.

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 sent to the server. If either the opdata_dn.opt_optl or the accessdata_dn.acc_userl are set to zero, that portion of the structure should be ignored.

If lpCalleeData is set to NULL, no optional data will be read from the server. If either the opdata_dn.opt_optl or the accessdata_dn.acc_userl are set to zero, that structure should be ignored. The accept function only returns optional data, not access data. So the lpCalleeData pointer should point to a buffer containing the OPTDATA_DN structure. If lpCalleeData is set to NULL no optional data will be read from the server.