#include <Socket.h>
|
| const IPAddress & | adr () const |
| |
| void | close () |
| | Closes the socket disconnecting it if necessary.
|
| |
| bool | isBlocking () const |
| |
| bool | isReady () const |
| | Tells whether there is some activity on the socket or not.
|
| |
| bool | isValid () const |
| | Tells whether the socket is opened or not.
|
| |
| bool | readyToReceive () const |
| |
| bool | readyToSend () const |
| |
| void | select (agx::UInt32 timeoutMillis=0) |
| |
| void | setBlocking (bool flag) |
| |
| | 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 244 of file Socket.h.
◆ ~Socket()
| virtual agxNet::Socket::~Socket |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ Socket()
◆ adr()
| const IPAddress & agxNet::Socket::adr |
( |
| ) |
const |
|
inline |
◆ close()
| void agxNet::Socket::close |
( |
| ) |
|
Closes the socket disconnecting it if necessary.
◆ getLastError()
| static int agxNet::Socket::getLastError |
( |
| ) |
|
|
static |
Returns the last reported error from a system call.
Should be called immediately after a socket/connect call has failed. Typically:
retval = ::select(int(handle + 1), &readMask, &writeMask, nullptr, &tv);
if (retval == M_SOCKET_ERROR)
int errorNo = Socket::getLastError();
◆ isBlocking()
| bool agxNet::Socket::isBlocking |
( |
| ) |
const |
|
inline |
◆ isReady()
| bool agxNet::Socket::isReady |
( |
| ) |
const |
|
inline |
Tells whether there is some activity on the socket or not.
See SocketSet class description for more info on how to use this method properly.
- Returns
- true if there is some data to read on the socket or if the remote socket has disconnected. The latter case can be detected by checking if subsequent Recv() method returns 0.
- false if there is no any activity on the socket.
Definition at line 277 of file Socket.h.
◆ isValid()
| bool agxNet::Socket::isValid |
( |
| ) |
const |
Tells whether the socket is opened or not.
TODO: write some detailed description.
- Returns
- Returns true if the socket is opened or false otherwise.
◆ operator=()
◆ readyToReceive()
| bool agxNet::Socket::readyToReceive |
( |
| ) |
const |
|
inline |
◆ readyToSend()
| bool agxNet::Socket::readyToSend |
( |
| ) |
const |
|
inline |
◆ select()
| void agxNet::Socket::select |
( |
agx::UInt32 |
timeoutMillis = 0 | ) |
|
◆ setBlocking()
| void agxNet::Socket::setBlocking |
( |
bool |
flag | ) |
|
◆ m_adr
◆ m_blocking
| bool agxNet::Socket::m_blocking |
|
protected |
◆ m_readyToReceive
| bool agxNet::Socket::m_readyToReceive |
|
protected |
◆ m_readyToSend
| bool agxNet::Socket::m_readyToSend |
|
protected |
◆ m_socket
The documentation for this class was generated from the following file: