Module: Essential Networking Module Package: Networking
Does not inherit
#include <rw/network/RWSocketAttribute.h>
RWSocketAttribute encapsulates conditions that may be true for a socket. An RWSocketAttribute serves two purposes: it is used to represent a set of attributes on a socket, and it is used to indicate that a particular attribute is true. It consists of two parts: the socket and the attribute.
RWSocketAttribute is used by the global function rwSocketSelect() for asynchronous I/O.
RWSocketAttribute();
Constructs a null attribute on the undefined socket.
RWSocketAttribute(const RWSocket& socket, Attribute attribute=NIL);
Constructs an attribute for a particular socket.
enum Attribute { sock_attr_nil = 0, // placebo sock_attr_canread = 1, // Data available for reading sock_attr_canwrite = 2, // Data available for writing sock_attr_exception = 4, // An exception, such as an // error or of band data sock_attr_isconnected = 8, // Connect has completed sock_attr_canaccept = 32, // A new connection is ready // to be accepted sock_attr_any = ~0 // Interested in any Attribute };
The Attribute type indicates the condition(s) on the socket. Attributes are used to indicate conditions of interest and to indicate what has happened on the socket. Attributes can be aggregated by ORing them together. For example, the attribute sock_attr_canread|sock_attr_canwrite on a socket indicates that the socket can either read or write.
The former enum values (NILL, CANREAD, CANWRITE, EXCEPTION, ISCONNECTED, CANACCEPT, ANY) have been retained, but are deprecated. You can refuse support for these values by defining the macro RW_AVOID_PREPROCESSOR_PROBLEMS.
Attribute getAttribute() const;
The attribute with which this is associated. The attribute may be a set of several Attributes ORed together.
RWSocket getSocket() const;
The socket with which the attribute is associated.
bool operator==(const RWSocketAttribute& x, const RWSocketAttribute& y);
Returns true if x and y refer to the same attribute(s) on the same socket.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.