Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNo next file
Essential Networking Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

rwSocketSelect

Module:  Essential Networking Module   Package:  Networking


Global Function

Local Index

Members

Declaration

#include <rw/network/RWSocketAttribute.h>

RWTValOrderedVector<RWSocketAttribute>
rwSocketSelect(
  const RWTValOrderedVector<RWSocketAttribute>& attributes);

RWTValOrderedVector<RWSocketAttribute>
rwSocketSelect(
  const RWTValOrderedVector<RWSocketAttribute>& attributes,
  double timeout);

Description

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 socket attributes. If empty, the program may sleep indefinitely. If one of the attributes refers to an invalid socket, a RWNetInvalidSocketError exception is thrown. If more than FD_SETSIZE attributes are in the attributes vector, an exception is thrown.

If the parameter timeout is defined, this call is guaranteed to block up to timeout seconds while waiting for a condition to become true. If the parameter is undefined, or 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, a RWNetSelectError is thrown. Note that when using large timeout values, the fractional part may change due to rounding.

Note: On stream sockets that are not connected,this function returns RWSocketAttribute::sock_attr_canwrite . This is a known issue with the underlying select() function, but it should not affect you. Most users do not want to call rwSocketSelect() on sockets that are not connected.



Previous fileTop of DocumentContentsIndex pageNo next file

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