Поделиться через


Supporting Connect and Disconnect Data with a WSH DLL

This topic is obsolete for Windows Server 2003, Windows Vista, and later. Windows Sockets Helper functions ( WSHXxx) are no longer supported.

Some transports, such as DECNet and OSI TP4, support connect and disconnect data: additional data, not in the normal network data stream, that is sent on the wire along with connect or disconnect requests. Typically, connect and disconnect data is used for operations like application-level version negotiation.

TDI supports the transmission of connect and disconnect data in the TDI_CONNECTION_INFORMATIONstructure, which has members specifying the UserDataLength, UserData, OptionsLength, and Options. This structure is passed in TDI connect, accept, and disconnect requests by kernel-mode TDI clients.

However, Windows Sockets does not provide input parameters for connect data to the connect function or for disconnect data to the shutdown and closesocket functions. WSH DLLS can add support for connect and disconnect data for applications that call the Windows Sockets setsockopt and getsockopt functions.

The setsockopt function can be called to specify connect and disconnect data to be sent to a remote node, and getsockoptcan be called to retrieve connect and disconnect data sent from the remote node. To support this, see the SO_XXX options in the header file, winsock.h.

How an application uses these options in conjunction with getsockopt and setsockopt depends on whether the application is a server or client, and on how the application uses the transmitted connect data. For information about client applications, see Client Applications and Connect Data. For information about server applications, see Server Applications and Connect Data. For transports, such as DECNet, that have a preexisting definition of connect data different from what is described here, a WSH DLL translates between the transport's semantics and the semantics expected by Windows Sockets, making calls to getsockopt and setsockopt.

Connect and disconnect options are effectively the same as connect and disconnect data from the standpoint of Windows Sockets. These are actually a buffer of data passed to the transport prior to the connect or disconnect, and a buffer containing data that is retrieved following a connect or disconnect. Consequently, an application uses connect or disconnect options in much the same manner as connect or disconnect data. The only difference is the option names used for the parameter passed to getsockopt and setsockopt; for example, SO_CONNOPT in place of SO_CONNDATA.

 

 

Send comments about this topic to Microsoft