Using rwSocketSelect
You can use the global function
rwSocketSelect() to test attributes and wait for them to become
true.
Example 15 shows how to wait on two sockets at the same time.
Example 15 – Using the global function rwSocketSelect
// Somehow establish two connected sockets, s1 and s2
RWTValOrderedVector<RWSocketAttribute> waiton; //1
waiton.append(RWSocketAttribute(
s1,RWSocketAttribute::CANREAD)); //2
waiton.append(RWSocketAttribute(
s2,RWSocketAttribute::CANREAD));
RWTValOrderedVector<RWSocketAttribute> ready =
rwSocketSelect(waiton); //3
// Do something with the sockets that are ready
NOTE: The Essential Networking Module page of the
SourcePro API Reference Guide describes
rwSocketSelect() in the Function Documentation section of that page.