SourcePro® 2024.1 |
SourcePro® API Reference Guide |
A type of socket communications channel. More...
#include <rw/network/RWSockType.h>
Public Member Functions | |
RWSockType () | |
RWSockType (const RWCString &familyName, int domain, int type=SOCK_STREAM, int protocol=0) | |
~RWSockType () | |
int | getDomain () const |
int | getFamily () const |
RWCString | getFamilyName () const |
int | getProtocol () const |
int | getType () const |
RWCString | id (unsigned level) const |
bool | operator!= (const RWSockType &) const |
bool | operator== (const RWSockType &) const |
RWSockType represents a type of socket communications channel. It is made up of a family (or domain), a type, and a protocol. An example of a family is the Internet TCP/IP family AF_INET
. A socket type is SOCK_STREAM
or SOCK_DGRAM
. A protocol could be PF_INET
or PF_UNSPEC
.
RWSockType::RWSockType | ( | ) |
Builds an invalid socket type. To set it to a valid type, use the assignment operator.
RWSockType::RWSockType | ( | const RWCString & | familyName, |
int | domain, | ||
int | type = SOCK_STREAM, | ||
int | protocol = 0 ) |
Builds a socket communication type descriptor. The domain specifies the type of communications channel. For the Internet domain, it is AF_INET
; for the Unix domain, it is AF_UNIX
. type specifies the type of channel, usually SOCK_STREAM
or SOCK_DGRAM
. The RWCString should contain 7-bit US-ASCII data.
RWSockType::~RWSockType | ( | ) |
Destructor.
|
inline |
Alias for getFamily().
|
inline |
Returns the integer identifier of the address domain for the socket type, such as AF_INET
for an Internet domain address.
|
inline |
Returns a string representation of the address domain, such as "inet" for the Internet address domain. The RWCString should contain 7-bit US-ASCII data.
|
inline |
Gets the protocol family that describes the socket type.
|
inline |
Gets the socket type that describes the socket protocol.
RWCString RWSockType::id | ( | unsigned | level | ) | const |
Returns a string describing self. The parameter level is currently unused. This method will return a string representing the address family and socket type.
Given the example input:
the following output would be returned:
bool RWSockType::operator!= | ( | const RWSockType & | ) | const |
Returns true
if any of the components (name, family, type, protocol) differ between the two classes.
bool RWSockType::operator== | ( | const RWSockType & | ) | const |
Returns true
if all components (name, family, type, protocol) in the two classes are equivalent.
Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |