#include <Socket.h>
|
| | SocketSet () |
| | Creates a socket set of the specified size.
|
| |
| bool | addSocket (Socket *sock) |
| | Add a socket to socket set.
|
| |
| bool | checkSockets (agx::UInt32 timeoutMillis) |
| | Check sockets from socket set for activity.
|
| |
| size_t | getMaxSockets () const |
| | Returns maximal number of sockets the system allows.
|
| |
| size_t | getNumSockets () const |
| | Returns number of sockets the socket set currently holds.
|
| |
| const SocketRefVector & | getSockets () const |
| |
| bool | removeSocket (Socket *sock) |
| | Remove socket from socket set.
|
| |
| | Referenced () |
| | Default constructor.
|
| |
| | Referenced (const Referenced &) |
| |
| template<typename T > |
| T * | as () |
| | Subclass casting.
|
| |
| template<typename T > |
| const T * | as () const |
| |
| template<typename T > |
| T * | asSafe () |
| | Safe subclass casting, return nullptr if template type does not match.
|
| |
| template<typename T > |
| const T * | asSafe () const |
| |
| int | getReferenceCount () const |
| |
| template<typename T > |
| bool | is () const |
| | Subclass test.
|
| |
| Referenced & | operator= (const Referenced &) |
| | Assignment operator. Will increment the number of references to the referenced object.
|
| |
| void | reference (void *ptr=nullptr) const |
| | Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
|
| |
| void | unreference (void *ptr=nullptr) const |
| | Decrement the reference count by one, indicating that a pointer to this object is referencing it.
|
| |
| void | unreference_nodelete () const |
| | Decrement the reference count by one, indicating that a pointer to this object is referencing it.
|
| |
Definition at line 539 of file Socket.h.
◆ SocketSet()
| agxNet::SocketSet::SocketSet |
( |
| ) |
|
Creates a socket set of the specified size.
Creates a socket set which can hold the specified number of sockets at maximum.
◆ ~SocketSet()
| virtual agxNet::SocketSet::~SocketSet |
( |
| ) |
|
|
inlineprotectedvirtual |
Destroys the socket set.
Note, that it does not destroy the sockets this set holds references to.
Definition at line 601 of file Socket.h.
◆ addSocket()
| bool agxNet::SocketSet::addSocket |
( |
Socket * |
sock | ) |
|
Add a socket to socket set.
- Parameters
-
| sock | - pointer to the socket object to add. |
- Returns
- false if socket is already added
◆ checkSockets()
| bool agxNet::SocketSet::checkSockets |
( |
agx::UInt32 |
timeoutMillis | ) |
|
Check sockets from socket set for activity.
This method checks sockets for activities of incoming data ready or remote socket has disconnected. This method sets ready flag for all sockets with activity which can later be checked by Socket::IsReady() method. The ready flag will be cleared by subsequent TCPSocket::Recv() function call.
- Parameters
-
| timeoutMillis | - maximum number of milliseconds to wait for socket activity to appear. if 0 is specified the function will not wait and will return immediately. |
- Returns
- true if there is at least one socket with activity.
-
false if there are no any sockets with activities.
◆ getMaxSockets()
| size_t agxNet::SocketSet::getMaxSockets |
( |
| ) |
const |
Returns maximal number of sockets the system allows.
- Returns
- maximal number of sockets available in the system.
◆ getNumSockets()
| size_t agxNet::SocketSet::getNumSockets |
( |
| ) |
const |
|
inline |
Returns number of sockets the socket set currently holds.
- Returns
- number of sockets the socket set currently holds.
Definition at line 553 of file Socket.h.
◆ getSockets()
◆ removeSocket()
| bool agxNet::SocketSet::removeSocket |
( |
Socket * |
sock | ) |
|
Remove socket from socket set.
- Parameters
-
| sock | - pointer to socket object which we want to remove from the set. |
- Returns
- false if socket is not previously added
The documentation for this class was generated from the following file: