OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TSocketAddress Class Reference

The TSocketAddress class stores a Winsock socket address. More...

#include <owl/wskaddr.h>

Inheritance diagram for owl::TSocketAddress:
owl::TINetSocketAddress

Public Member Functions

 TSocketAddress ()
 Only the family is specified. The rest of the data is currently undefined.
 
 TSocketAddress (const sockaddr &src)
 The argument is a socket address in network byte ordering.
 
 TSocketAddress (const TSocketAddress &src)
 The argument address should be in network byte ordering.
 
 TSocketAddress (ushort family, char *data, short dataLength)
 The argument address should be in network byte ordering.
 
TSocketAddressoperator= (const sockaddr &src)
 The argument address should be in network byte ordering.
 
ushort GetFamily () const
 Returns the family of addressing this address belongs to.
 
void SetFamily (ushort family)
 Sets the family of addressing this address belongs to.
 
void SetAddress (ushort family, const char *data, short dataLength)
 'newFamily' is AF_INET, etc.
 

Friends

bool operator== (const TSocketAddress &address1, const TSocketAddress &address2)
 Both addresses should be in the same byte ordering as each other.
 

Detailed Description

The TSocketAddress class stores a Winsock socket address.

This class is much like the sockaddr class; in fact, it is a subclass of sockaddr. Note that the TSocketAddress class does not store Internet (IP) addresses specifically. It stores generic socket addresses. The TINetSocketAddress class is used to store Internet addresses.

TSocketAddress normally stores its data in network byte ordering, as opposed to host byte ordering.

Definition at line 38 of file wskaddr.h.

Constructor & Destructor Documentation

◆ TSocketAddress() [1/4]

owl::TSocketAddress::TSocketAddress ( )

Only the family is specified. The rest of the data is currently undefined.

Definition at line 20 of file wskaddr.cpp.

◆ TSocketAddress() [2/4]

owl::TSocketAddress::TSocketAddress ( const sockaddr & src)

The argument is a socket address in network byte ordering.

Definition at line 28 of file wskaddr.cpp.

References operator=().

◆ TSocketAddress() [3/4]

owl::TSocketAddress::TSocketAddress ( const TSocketAddress & src)

The argument address should be in network byte ordering.

Definition at line 36 of file wskaddr.cpp.

References operator=().

◆ TSocketAddress() [4/4]

owl::TSocketAddress::TSocketAddress ( ushort family,
char * data,
short dataLength )

The argument address should be in network byte ordering.

Definition at line 44 of file wskaddr.cpp.

References SetAddress().

Member Function Documentation

◆ GetFamily()

ushort owl::TSocketAddress::GetFamily ( ) const
inline

Returns the family of addressing this address belongs to.

Definition at line 118 of file wskaddr.h.

◆ operator=()

TSocketAddress & owl::TSocketAddress::operator= ( const sockaddr & src)

The argument address should be in network byte ordering.

Definition at line 52 of file wskaddr.cpp.

References SetAddress().

◆ SetAddress()

void owl::TSocketAddress::SetAddress ( ushort family,
const char * data,
short dataLength )

'newFamily' is AF_INET, etc.

'data' is a pointer to data in the same format as sockaddr.sa_data[]. 'dataLength' is the length of data. It is limited to 14 bytes in WinSock 1.1. The passed data should be in network byte ordering.

Definition at line 80 of file wskaddr.cpp.

◆ SetFamily()

void owl::TSocketAddress::SetFamily ( ushort family)
inline

Sets the family of addressing this address belongs to.

Definition at line 127 of file wskaddr.h.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const TSocketAddress & address1,
const TSocketAddress & address2 )
friend

Both addresses should be in the same byte ordering as each other.

We just happen to know for a fact that the sockaddr's have same data as TSocketAddress's.

Definition at line 63 of file wskaddr.cpp.


The documentation for this class was generated from the following files: