SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWWinSockInfo Class Reference

Initializes the Winsock DLL on Windows platforms. More...

#include <rw/network/RWWinSockInfo.h>

Public Member Functions

 RWWinSockInfo (FARPROC blockingHook)
 
 RWWinSockInfo (short ver=0x0202)
 
 ~RWWinSockInfo (void)
 
RWCString getDescription (void) const
 
int getMajorVersion (void) const
 
int getMinorVersion (void) const
 

Detailed Description

Initializes the Winsock DLL on Windows platforms. Initialization is required before your application can make requests of the Winsock API. Deregistration is required for applications that no longer need Winsock services.

Rogue Wave encourages all users to include this class in their code. While using this class does not affect the behavior of programs that run on UNIX, it does make them portable to Windows environments.

Note
If you use Winsock.dll in a DLL, either directly or indirectly, you must initialize it. The fastest way to do this may be to create an instance of RWWinSockInfo in DllMain().

Constructor & Destructor Documentation

◆ RWWinSockInfo() [1/2]

RWWinSockInfo::RWWinSockInfo ( short ver = 0x0202)

Initializes the underlying socket API with the requested version. If the Winsock DLL has already been initialized by this application, the constructor does nothing. An exception of type RWNetWinsockInitError is thrown if the initialization fails. This function is a no-op on non Windows platforms.

◆ ~RWWinSockInfo()

RWWinSockInfo::~RWWinSockInfo ( void )

Performs the termination tasks.

◆ RWWinSockInfo() [2/2]

RWWinSockInfo::RWWinSockInfo ( FARPROC blockingHook)
Deprecated
As of SourcePro 4. Blocking hooks are no longer supported by the Windows Socket 2 API.

Initializes the Winsock DLL and installs the blocking hook indicated. The previous blocking hook is restored when the RWWinSockInfo is destroyed.

Condition:
Available only on the Windows platform.

Member Function Documentation

◆ getDescription()

RWCString RWWinSockInfo::getDescription ( void ) const

Returns the vendor-supplied description of the Winsock DLL. The string "not winsock" is returned on platforms that do not support winsock.

◆ getMajorVersion()

int RWWinSockInfo::getMajorVersion ( void ) const

Returns the vendor-supplied major version of the Winsock DLL. Returns 0 on platforms that do not support Winsock.

◆ getMinorVersion()

int RWWinSockInfo::getMinorVersion ( void ) const

Returns the vendor-supplied minor version of the Winsock DLL. Returns 0 on platforms that do not support Winsock.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.