#include <Socket.h>
Definition at line 408 of file Socket.h.
| agxNet::TCPServerSocket::TCPServerSocket |
( |
| ) |
|
|
inline |
Creates an invalid (unopened) TCP server socket.
Definition at line 413 of file Socket.h.
A copy constructor.
Copy constructor creates a new socket object which refers to the same socket as s. After constructor completes the s becomes invalid. In other words, the behavior of copy constructor is similar to one of std::auto_ptr class from standard C++ library.
- Parameters
-
| s | - other TCP socket to make a copy from. |
Definition at line 423 of file Socket.h.
| agxNet::TCPServerSocket::TCPServerSocket |
( |
agx::UInt16 |
port, |
|
|
bool |
disableNaggle = false |
|
) |
| |
|
inline |
A constructor which automatically calls TCPServerSocket::Open() method.
This constructor creates a socket and calls its TCPServerSocket::Open() method. So, it creates an already opened socket listening on the specified port.
- Parameters
-
| port | - IP port number to listen on. |
| disableNaggle | - enable/disable Naggle algorithm for all accepted connections. |
Definition at line 447 of file Socket.h.
| TCPSocket* agxNet::TCPServerSocket::accept |
( |
| ) |
|
Accepts one of the pending connections, non-blocking.
Accepts one of the pending connections and returns a TCP socket object which represents either a valid connected socket or an invalid socket object. This function does not block if there is no any pending connections, it just returns invalid socket object in this case. One can periodically check for incoming connections by calling this method.
- Returns
- A pointer to a TCPSocket object if a valid socket could be initialized. Returns nullptr if there was no any connections pending, so no connection was accepted.
| const IPAddress& agxNet::Socket::adr |
( |
| ) |
const |
|
inlineinherited |
| void agx::Referenced::allocateObserverVector |
( |
| ) |
const |
|
protectedinherited |
template<typename T >
| T* agx::Referenced::as |
( |
| ) |
|
|
inherited |
template<typename T >
| const T* agx::Referenced::as |
( |
| ) |
const |
|
inherited |
template<typename T >
| T* agx::Referenced::asSafe |
( |
| ) |
|
|
inherited |
template<typename T >
| const T* agx::Referenced::asSafe |
( |
| ) |
const |
|
inherited |
| void agxNet::Socket::close |
( |
| ) |
|
|
inherited |
Closes the socket disconnecting it if necessary.
| void agx::Referenced::deleteUsingDeleteHandler |
( |
| ) |
const |
|
protectedinherited |
| int agx::Referenced::getReferenceCount |
( |
| ) |
const |
|
inherited |
- Returns
- the number pointers currently referencing this object.
template<typename T >
| bool agx::Referenced::is |
( |
| ) |
const |
|
inherited |
| bool agxNet::Socket::isBlocking |
( |
| ) |
const |
|
inlineinherited |
| bool agxNet::Socket::isReady |
( |
| ) |
const |
|
inlineinherited |
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 268 of file Socket.h.
| bool agxNet::Socket::isValid |
( |
| ) |
const |
|
inherited |
Tells whether the socket is opened or not.
TODO: write some detailed description.
- Returns
- Returns true if the socket is opened or false otherwise.
| void agxNet::TCPServerSocket::open |
( |
agx::UInt16 |
port, |
|
|
bool |
disableNaggle = false |
|
) |
| |
Connects the socket or starts listening on it.
This method starts listening on the socket for incoming connections.
- Parameters
-
| port | - IP port number to listen on. |
| disableNaggle | - enable/disable Naggle algorithm for all accepted connections. |
Assignment operator, works similar to std::auto_ptr::operator=().
After this assignment operator completes this socket object refers to the socket the s object referred, s become invalid. It works similar to std::auto_ptr::operator=() from standard C++ library.
- Parameters
-
| s | - socket to assign from. |
Definition at line 435 of file Socket.h.
References agxNet::Socket::operator=().
| bool agxNet::Socket::readyToReceive |
( |
| ) |
const |
|
inlineinherited |
| bool agxNet::Socket::readyToSend |
( |
| ) |
const |
|
inlineinherited |
| void agx::Referenced::reference |
( |
void * |
ptr = nullptr | ) |
const |
|
inherited |
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
Referenced by agxData::Val< UInt >::Val().
| void agxNet::Socket::setBlocking |
( |
bool |
flag | ) |
|
|
inherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
| void agx::Referenced::unreference |
( |
void * |
ptr = nullptr | ) |
const |
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
| void agx::Referenced::unreference_nodelete |
( |
| ) |
const |
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
template<typename T >
| static bool agx::Referenced::ValidateCast |
( |
const Referenced * |
object | ) |
|
|
staticinherited |
| bool agxNet::Socket::m_blocking |
|
protectedinherited |
| Mutex agx::Referenced::m_mutex |
|
mutableprotectedinherited |
|
|
mutableprotectedinherited |
| bool agxNet::Socket::m_readyToReceive |
|
protectedinherited |
| bool agxNet::Socket::m_readyToSend |
|
protectedinherited |
| AtomicValue agx::Referenced::m_refCount |
|
mutableprotectedinherited |
The documentation for this class was generated from the following file: