rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWSecureSocketAttribute Class Reference
[Secure Sockets]

Encapsulates socket conditions. More...

#include <rw/secsock/RWSecureSocketAttribute.h>

List of all members.

Public Types

enum  Attribute {
  sock_attr_nil, sock_attr_canread, sock_attr_canwrite, sock_attr_exception,
  sock_attr_isconnected, sock_attr_canaccept, sock_attr_any
}

Public Member Functions

 RWSecureSocketAttribute (void)
 RWSecureSocketAttribute (const RWSecureSocket &socket, Attribute attribute=sock_attr_nil)
 RWSecureSocketAttribute (const RWSecureSocketAttribute &second)
 ~RWSecureSocketAttribute (void)
RWSecureSocketAttributeoperator= (const RWSecureSocketAttribute &second)
RWSecureSocket getSocket (void) const
Attribute getAttribute (void) const
bool operator< (const RWSecureSocketAttribute &s) const

Related Functions

(Note that these are not member functions.)



RWTValOrderedVector
< RWSecureSocketAttribute
rwSecureSocketSelect (const RWTValOrderedVector< RWSecureSocketAttribute > &attributes)
RWTValOrderedVector
< RWSecureSocketAttribute
rwSecureSocketSelect (const RWTValOrderedVector< RWSecureSocketAttribute > &, double timeout)
bool operator== (const RWSecureSocketAttribute &x, const RWSecureSocketAttribute &y)

Detailed Description

RWSecureSocketAttribute encapsulates socket conditions.


Member Enumeration Documentation

These are the attributes of a socket connection. These conditions may be ORed together. For example, the attribute sock_attr_canread|sock_attr_canwrite on a socket indicates that both the attributes are set for the underlying socket.

Enumerator:
sock_attr_nil 

No attributes.

sock_attr_canread 

Data is available for reading.

sock_attr_canwrite 

Data is available for writing.

sock_attr_exception 

Deprecated; avoid.

sock_attr_isconnected 

Connect operation has completed.

sock_attr_canaccept 

A new connection is ready to be accepted.

sock_attr_any 

Any Attribute.


Constructor & Destructor Documentation

RWSecureSocketAttribute::RWSecureSocketAttribute ( void   ) 

Constructs a null attribute on the undefined socket.

RWSecureSocketAttribute::RWSecureSocketAttribute ( const RWSecureSocket socket,
Attribute  attribute = sock_attr_nil 
)

Constructs an attribute for a particular socket.

RWSecureSocketAttribute::RWSecureSocketAttribute ( const RWSecureSocketAttribute second  ) 

Copy constructor.

RWSecureSocketAttribute::~RWSecureSocketAttribute ( void   ) 

Destructor.


Member Function Documentation

RWSecureSocketAttribute::Attribute RWSecureSocketAttribute::getAttribute ( void   )  const [inline]

Returns the attribute with which self is associated. The returned attribute may be a composite of several attributes ORed together.

RWSecureSocket RWSecureSocketAttribute::getSocket ( void   )  const [inline]

Returns the socket with which the attribute is associated.

bool RWSecureSocketAttribute::operator< ( const RWSecureSocketAttribute s  )  const

Defined to satisfy some C++ compilers. Should never be invoked by application code. Invoking this operator causes an exception to be thrown.

RWSecureSocketAttribute& RWSecureSocketAttribute::operator= ( const RWSecureSocketAttribute second  ) 

Assignment operator.


Friends And Related Function Documentation

bool operator== ( const RWSecureSocketAttribute x,
const RWSecureSocketAttribute y 
) [related]

Returns true if x and y refer to the same attribute on the same socket.

RWTValOrderedVector< RWSecureSocketAttribute > rwSecureSocketSelect ( const RWTValOrderedVector< RWSecureSocketAttribute > &  ,
double  timeout 
) [related]

This function helps to perform asynchronous socket input/output operations. It waits for one of the conditions in the user-defined attributes vector to occur, and returns a vector of the conditions that have occurred. If any of the conditions has already occurred when the function is called, it returns immediately.

The attributes parameter is a vector of secure socket attributes. If empty, the program may sleep indefinitely. If one of the attributes refers to an invalid socket, a RWSecureSocketInvalidSocketError exception is thrown. If more than FD_SETSIZE attributes are in the attributes vector, an exception is thrown.

This function is guaranteed to block up to timeout seconds while waiting for a condition to become true. If the parameter has a value less than 0, the method blocks indefinitely waiting for a condition to become true. If the value is greater than LONG_MAX, it will be truncated to LONG_MAX. Note that when using large timeout values, the fractional part may change due to rounding.

Note:
This function operates on the TCP socket underlying the SSL/TLS connection. As a result, you may receive unexpected results. Please see the Secure Communication Module User's Guide for more information.
RWTValOrderedVector< RWSecureSocketAttribute > rwSecureSocketSelect ( const RWTValOrderedVector< RWSecureSocketAttribute > &  attributes  )  [related]

This function helps to perform asynchronous socket input/output operations. It waits for one of the conditions in the user-defined attributes vector to occur, and returns a vector of the conditions that have occurred. If any of the conditions has already occurred when the function is called, it returns immediately.

The attributes parameter is a vector of secure socket attributes. If empty, the program may sleep indefinitely. If one of the attributes refers to an invalid socket, a RWSecureSocketInvalidSocketError exception is thrown. If more than FD_SETSIZE attributes are in the attributes vector, an exception is thrown.

Note:
This function operates on the TCP socket underlying the SSL/TLS connection. As a result, you may receive unexpected results. Please see the Secure Communication Module User's Guide for more information.
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© 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.