The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CUsesMSWinSockExtensions Class Reference
[RAII - Resource Acquisition Is Initialization]

Inheritance diagram for CUsesMSWinSockExtensions:
Collaboration diagram for CUsesMSWinSockExtensions:

List of all members.


Detailed Description

This class acts as a dynamic function loader for the MS Winsock extension functions via a WSAIoctl() call with SIO_GET_EXTENSION_FUNCTION_POINTER. The assumption is made that all sockets passed to this class will be from the same underlying provider (or, at the very least, all sockets passed to a particular extension function will be from the same provider).

Public Member Functions

 CUsesMSWinSockExtensions ()
 CUsesMSWinSockExtensions (const CUsesMSWinSockExtensions &rhs)
 ~CUsesMSWinSockExtensions () override
CUsesMSWinSockExtensionsoperator= (const CUsesMSWinSockExtensions &rhs)
bool ConnectEx (SOCKET s, const struct sockaddr FAR *name, int namelen, PVOID lpSendBuffer, DWORD dwSendDataLength, LPDWORD lpdwBytesSent, LPOVERLAPPED lpOverlapped) const
 Loads, if necessary and available, and then calls ConnectEx(). If the function isn't available then an exception is thrown.
bool LoadConnectEx (SOCKET s) const
 Attempts to load ConnectEx() via a call to WSAIoctl(). Returns true if successful.
bool AcceptEx (SOCKET listenSocket, SOCKET acceptSocket, PVOID pOutputBuffer, DWORD receiveDataLength, DWORD localAddressLength, DWORD remoteAddressLength, LPDWORD bytesReceived, LPOVERLAPPED pOverlapped) const
 Loads, if necessary and available, and then calls AcceptEx(). If the function isn't available then an exception is thrown.
bool LoadAcceptEx (SOCKET s) const
 Attempts to load AcceptEx() via a call to WSAIoctl(). Returns true if successful.
void GetAcceptExSockaddrs (PVOID pOutputBuffer, DWORD receiveDataLength, DWORD localAddressLength, DWORD remoteAddressLength, LPSOCKADDR *pLocalSockaddr, LPINT pLocalSockaddrLength, LPSOCKADDR *pRemoteSockaddr, LPINT pRemoteSockaddrLength) const
 Loads, if necessary and available, and then calls GetAcceptExSockaddrs(). If the function isn't available then an exception is thrown.
bool LoadGetAcceptExSockaddrs (SOCKET s) const
 Attempts to load GetAcceptExSockaddrs() via a call to WSAIoctl(). Returns true if successful.
bool DisconnectEx (SOCKET s, LPOVERLAPPED pOverlapped, DWORD flags) const
 Loads, if necessary and available, and then calls DisconnectEx(). If the function isn't available then an exception is thrown.
bool LoadDisconnectEx (SOCKET s) const
 Attempts to load DisconnectEx() via a call to WSAIoctl(). Returns true if successful.
bool TransmitFile (SOCKET s, HANDLE fileToTransmit, DWORD numberOfBytesToWrite, DWORD numberOfBytesPerSend, LPOVERLAPPED lOverlapped, LPTRANSMIT_FILE_BUFFERS lTransmitBuffers, DWORD flags) const
 Loads, if necessary and available, and then calls TransmitFile(). If the function isn't available then an exception is thrown.
bool LoadTransmitFile (SOCKET s) const
 Attempts to load TransmitFile() via a call to WSAIoctl(). Returns true if successful.
bool DisconnectSocketForReuse (SOCKET s) const
 Attempts to disconnect a socket for reuse first by attempting to call DisconnectEx() and then by attempting to call TransmitFile() in 'disconnect for reuse mode' see http://msdn2.microsoft.com/en-us/library/ms740565.aspx for details. If neither option is available then an exception is thrown.
bool CanDisconnectSocketForReuse (SOCKET s) const
 Returns true if either DisconnectEx() or TransmitFile() can be a call to WSAIoctl().
int WSARecvMsg (SOCKET s, LPWSAMSG lpMsg, LPDWORD lpdwNumberOfBytesRecvd, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) const
 Loads, if necessary and available, and then calls WSARecvMsg(). If the function isn't available then an exception is thrown.
bool LoadWSARecvMsg (SOCKET s) const
 Attempts to load WSARecvMsg() via a call to WSAIoctl(). Returns true if successful.

Constructor & Destructor Documentation

~CUsesMSWinSockExtensions (  )  [override]


Member Function Documentation

CUsesMSWinSockExtensions& operator= ( const CUsesMSWinSockExtensions rhs  ) 

bool ConnectEx ( SOCKET  s,
const struct sockaddr FAR *  name,
int  namelen,
PVOID  lpSendBuffer,
DWORD  dwSendDataLength,
LPDWORD  lpdwBytesSent,
LPOVERLAPPED  lpOverlapped 
) const

Loads, if necessary and available, and then calls ConnectEx(). If the function isn't available then an exception is thrown.

bool LoadConnectEx ( SOCKET  s  )  const

Attempts to load ConnectEx() via a call to WSAIoctl(). Returns true if successful.

bool AcceptEx ( SOCKET  listenSocket,
SOCKET  acceptSocket,
PVOID  pOutputBuffer,
DWORD  receiveDataLength,
DWORD  localAddressLength,
DWORD  remoteAddressLength,
LPDWORD  bytesReceived,
LPOVERLAPPED  pOverlapped 
) const

Loads, if necessary and available, and then calls AcceptEx(). If the function isn't available then an exception is thrown.

bool LoadAcceptEx ( SOCKET  s  )  const

Attempts to load AcceptEx() via a call to WSAIoctl(). Returns true if successful.

void GetAcceptExSockaddrs ( PVOID  pOutputBuffer,
DWORD  receiveDataLength,
DWORD  localAddressLength,
DWORD  remoteAddressLength,
LPSOCKADDR *  pLocalSockaddr,
LPINT  pLocalSockaddrLength,
LPSOCKADDR *  pRemoteSockaddr,
LPINT  pRemoteSockaddrLength 
) const

Loads, if necessary and available, and then calls GetAcceptExSockaddrs(). If the function isn't available then an exception is thrown.

bool LoadGetAcceptExSockaddrs ( SOCKET  s  )  const

Attempts to load GetAcceptExSockaddrs() via a call to WSAIoctl(). Returns true if successful.

bool DisconnectEx ( SOCKET  s,
LPOVERLAPPED  pOverlapped,
DWORD  flags 
) const

Loads, if necessary and available, and then calls DisconnectEx(). If the function isn't available then an exception is thrown.

bool LoadDisconnectEx ( SOCKET  s  )  const

Attempts to load DisconnectEx() via a call to WSAIoctl(). Returns true if successful.

bool TransmitFile ( SOCKET  s,
HANDLE  fileToTransmit,
DWORD  numberOfBytesToWrite,
DWORD  numberOfBytesPerSend,
LPOVERLAPPED  lOverlapped,
LPTRANSMIT_FILE_BUFFERS  lTransmitBuffers,
DWORD  flags 
) const

Loads, if necessary and available, and then calls TransmitFile(). If the function isn't available then an exception is thrown.

bool LoadTransmitFile ( SOCKET  s  )  const

Attempts to load TransmitFile() via a call to WSAIoctl(). Returns true if successful.

bool DisconnectSocketForReuse ( SOCKET  s  )  const

Attempts to disconnect a socket for reuse first by attempting to call DisconnectEx() and then by attempting to call TransmitFile() in 'disconnect for reuse mode' see http://msdn2.microsoft.com/en-us/library/ms740565.aspx for details. If neither option is available then an exception is thrown.

bool CanDisconnectSocketForReuse ( SOCKET  s  )  const

Returns true if either DisconnectEx() or TransmitFile() can be a call to WSAIoctl().

int WSARecvMsg ( SOCKET  s,
LPWSAMSG  lpMsg,
LPDWORD  lpdwNumberOfBytesRecvd,
LPWSAOVERLAPPED  lpOverlapped,
LPWSAOVERLAPPED_COMPLETION_ROUTINE  lpCompletionRoutine 
) const

Loads, if necessary and available, and then calls WSARecvMsg(). If the function isn't available then an exception is thrown.

bool LoadWSARecvMsg ( SOCKET  s  )  const

Attempts to load WSARecvMsg() via a call to WSAIoctl(). Returns true if successful.


Generated on Sun Sep 12 19:10:45 2021 for The Server Framework - v7.4 by doxygen 1.5.3