OWLNext 7.0
Borland's Object Windows Library for the modern age
|
A class that starts up WinSock and provides information about the system's WinSock. More...
#include <owl/wsksockm.h>
Public Member Functions | |
TSocketManager (short versionMajor=1, short versionMinor=1, bool autoStartup=true) | |
The SocketManager constructor takes a major and minor version as parameters. | |
virtual | ~TSocketManager () |
The TSocketManager destructor cleans up after itself. | |
void | Init (short versionMajor=1, short versionMinor=1) |
The ITSocketManager function does some initialization for the TSocketManager. | |
int | Startup () |
The Startup() function is equivalent to the Winsock WSAStartup() function. | |
int | ShutDown () |
The ShutDown() function is the equivalent to the Winsock WSACleanup() function. | |
int | IsAvailable () |
Returns true if WinSock is available. | |
int | GetMajorVersion () |
Returns the major version of WinSock support. | |
int | GetMinorVersion () |
Returns the minor version of WinSock support. | |
char * | GetDescription () |
Returns the system's description of WinSock. | |
char * | GetSystemStatus () |
Returns the status of WinSock. | |
ushort | GetMaxUdpDgAvailable () |
Returns maximum number of bytes each UDP packet can be. | |
ushort | GetMaxSocketsAvailable () |
Returns maximum number of WinSock connections avaialble. | |
char * | GetVendorInfo () |
Returns this WinSocket's vendor's information. | |
int | GetLastError () |
Returns the last error code. | |
void | Information (TSocketInfo &socketInfo) |
Sets the information about this WinSocket. | |
Protected Attributes | |
int | LastError |
Last error code. | |
short | Available |
Flag for Winsock availability. | |
short | StartupCount |
Make sure to not overflow number of connects. | |
TSocketInfo | SocketInfo |
Information about this WinSocket implementation. | |
short | VersionMajor |
Major verion number. | |
short | VersionMinor |
Minor verion number. | |
A class that starts up WinSock and provides information about the system's WinSock.
Definition at line 44 of file wsksockm.h.
owl::TSocketManager::TSocketManager | ( | short | versionMajor = 1, |
short | versionMinor = 1, | ||
bool | autoStartup = true ) |
The SocketManager constructor takes a major and minor version as parameters.
These version parameters are the Winsock versions that can be requested, as with WSAStartup() calls.
Definition at line 38 of file wsksockm.cpp.
References Init(), owl::TWinSock::IsAvailable(), Startup(), and StartupCount.
|
virtual |
The TSocketManager destructor cleans up after itself.
Every time Startup() (same as WSAStartup()) is called, this destructor will call ShutDown (same as WSACleanup()).
Definition at line 53 of file wsksockm.cpp.
References ShutDown(), and StartupCount.
|
inline |
Returns the system's description of WinSock.
Definition at line 113 of file wsksockm.h.
References SocketInfo.
|
inline |
|
inline |
Returns the major version of WinSock support.
Definition at line 95 of file wsksockm.h.
References VersionMajor.
|
inline |
Returns maximum number of WinSock connections avaialble.
Definition at line 140 of file wsksockm.h.
References SocketInfo.
|
inline |
Returns maximum number of bytes each UDP packet can be.
Definition at line 131 of file wsksockm.h.
References SocketInfo.
|
inline |
Returns the minor version of WinSock support.
Definition at line 104 of file wsksockm.h.
References VersionMinor.
|
inline |
|
inline |
Returns this WinSocket's vendor's information.
Definition at line 149 of file wsksockm.h.
References SocketInfo.
|
inline |
Sets the information about this WinSocket.
Definition at line 167 of file wsksockm.h.
References SocketInfo.
The ITSocketManager function does some initialization for the TSocketManager.
This function is separate from the constructor so it can be called at any time to re-specify the desired major and minor versions before a call to Startup(). nNewVersionMajor and nNewVersionMinor will be the values specified in the Winsock WSAStartup() call that TSocketManager::Startup() makes. The return value is TRUE or FALSE.
Definition at line 67 of file wsksockm.cpp.
References LastError, VersionMajor, and VersionMinor.
|
inline |
Returns true if WinSock is available.
Definition at line 86 of file wsksockm.h.
References Available.
int owl::TSocketManager::ShutDown | ( | ) |
The ShutDown() function is the equivalent to the Winsock WSACleanup() function.
You can call this function if you want, but in its destructor, the TSocketManager will automatically call it once for every time Startup() was called. Of course, the TSocketManager cannot know about any independent WSAStartup() direct calls that are made.
Definition at line 103 of file wsksockm.cpp.
References LastError, StartupCount, WINSOCK_ERROR, WINSOCK_NOERROR, owl::TWinSockDll::WSACleanup(), and owl::TWinSockDll::WSAGetLastError().
int owl::TSocketManager::Startup | ( | ) |
The Startup() function is equivalent to the Winsock WSAStartup() function.
This function fills out the TSocketManager's SocketInfo structure (same as a WSAData structure) with the return information. GetMaxSocketsAvailable(), GetVendorInfo(), Available(), GetMajorVersion(), GetMinorVersion(), or Information() functions can then be called to get the results of the call.
Definition at line 81 of file wsksockm.cpp.
References owl::HiUint8(), LastError, owl::LoUint8(), SocketInfo, StartupCount, VersionMajor, VersionMinor, WINSOCK_ERROR, WINSOCK_NOERROR, and owl::TWinSockDll::WSAStartup().
|
protected |
Flag for Winsock availability.
Definition at line 68 of file wsksockm.h.
|
protected |
Last error code.
Definition at line 67 of file wsksockm.h.
|
protected |
Information about this WinSocket implementation.
Definition at line 70 of file wsksockm.h.
|
protected |
Make sure to not overflow number of connects.
Definition at line 69 of file wsksockm.h.
|
protected |
Major verion number.
Definition at line 71 of file wsksockm.h.
|
protected |
Minor verion number.
Definition at line 72 of file wsksockm.h.