#include <socket_manager.hpp>
|
| std::map< int, std::shared_ptr< ARION_SOCKET > > | sockets |
| | A map identifying a socket given its UNIX file descriptor.
|
| |
|
| std::weak_ptr< Arion > | arion |
| | The Arion instance associated to this instance.
|
| |
This class handles socket-related operations. It maintains a mapping of file descriptors to their respective ARION_SOCKET instances.
◆ SocketManager()
| arion::SocketManager::SocketManager |
( |
std::weak_ptr< Arion > |
arion | ) |
|
|
inline |
Builder for SocketManager instances.
- Parameters
-
| [in] | arion | The Arion instance associated to this instance. |
◆ add_socket_entry()
| void arion::SocketManager::add_socket_entry |
( |
int |
target_fd, |
|
|
std::shared_ptr< ARION_SOCKET > |
socket |
|
) |
| |
Inserts a new socket to the "sockets" vector.
- Parameters
-
| [in] | target_fd | The UNIX file descriptor for the new socket, in the emulation context. |
| [in] | socket | The new socket to be inserted. |
◆ get_arion_socket()
| std::shared_ptr< ARION_SOCKET > arion::SocketManager::get_arion_socket |
( |
int |
target_fd | ) |
|
Retrieves an ARION_SOCKET instance from a UNIX file descriptor from the emulation context.
- Parameters
-
| [in] | target_fd | The UNIX file descriptor. |
- Returns
- The retrieved ARION_SOCKET.
◆ has_socket_entry()
| bool arion::SocketManager::has_socket_entry |
( |
int |
target_fd | ) |
|
Checks whether the "sockets" vector contains a given file descriptor.
- Parameters
-
| [in] | target_fd | The UNIX socket descriptor. |
- Returns
- True if the "sockets" vector contains the file descriptor.
◆ initialize()
| static std::unique_ptr< SocketManager > arion::SocketManager::initialize |
( |
std::weak_ptr< Arion > |
arion | ) |
|
|
static |
Instanciates and initializes new SocketManager objects with some parameters.
- Parameters
-
| [in] | arion | The Arion instance used for emulation. |
- Returns
- A new SocketManager instance.
◆ rm_socket_entry()
| void arion::SocketManager::rm_socket_entry |
( |
int |
target_fd | ) |
|
Removes a file entry from the "sockets" vector.
- Parameters
-
| [in] | target_fd | The UNIX file descriptor of the socket to be removed. |
◆ arion
| std::weak_ptr<Arion> arion::SocketManager::arion |
|
private |
The Arion instance associated to this instance.
◆ sockets
| std::map<int, std::shared_ptr<ARION_SOCKET> > arion::SocketManager::sockets |
A map identifying a socket given its UNIX file descriptor.
The documentation for this class was generated from the following file: