Working with Socket Attributes
Socket attributes indicate conditions on a socket. For example, a socket attribute might indicate that a socket is ready for reading or writing, or that it is successfully connected. When a socket attribute is true, it means that the corresponding operation on the socket can be executed without blocking.
A socket attribute is represented by an instance of the
RWSocketAttribute class. An
RWSocketAttribute has two parts: a socket and an attribute, where the attribute is a combination of any of the following:
RWSocketAttribute::sock_attr_canread | Data is available for reading. |
RWSocketAttribute::sock_attr_canwrite | Data can be written on the socket. |
RWSocketAttribute::sock_attr_exception | An exceptional condition, such as the arrival of out-of-band data, has occurred. |
RWSocketAttribute::sock_attr_isconnected | The socket is connected. |
RWSocketAttribute::sock_attr_canaccept | A connection has arrived on this socket and can be received using RWSocket::accept(). |
Applications can set multiple attributes by bitwise OR-ing them together.