Networking Tools: Network Communication Classes (net library)
#include <rw/toolpro/sockaddr.h>
net, tls (and possibly std)
RWSockType represents a type of socket communications channel. It has three components: the family, the type, and the protocol. You cannot construct a valid RWSockType directly. Instead, derived classes, such as RWInetType, can be constructed and assigned to an RWSockType.
An RWSockType represents a type of socket communications, but without an address attached to it. It is made up of a family (sometimes called a domain), a socket type, and a protocol. An example of a family is the Internet TCP/IP family. A socket type is stream or datagram. A protocol could be TCP or UDP.
RWSockType();
The default constructor builds an invalid socket type. To set it to a valid type, use the assignment operator.
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, this is AF_INET; for Unix domain, AF_UNIX. The type specifies the type of channel, usually SOCK_STREAM or SOCK_DGRAM.
RWSockType(const RWSockType& x);
Creates a copy of x.
int domain() const {return family_;} int family() const {return family_;}
Returns the integer identifier of the address domain for the socket type (for example, AF_INET for an Internet domain address.) family() and domain() are synonyms.
RWCString familyName() const {return familyName_;}
Returns a string representation of the address domain (for example, "inet" for the Internet address domain.)
RWCString id(unsigned level=0);
Returns a string describing self. The verbosity of the output is controlled by level with level=0 being the most basic and level=9 the most verbose.
int protocol() const {return protocol_;}
Gets the pieces that describe the socket type.
int type() const {return type_;}
Gets the pieces that describe the socket protocol.
RWBoolean operator==(const RWSockType&) const;
Returns TRUE if all of the components (name, family, type, protocol) in the two classes are equivalent.
RWBoolean operator!=(const RWSockType&) const;
Returns TRUE if any of the components (name, family, type, protocol) differ between the two classes.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.