Internal base class encapsulating a socket (or file) descriptor and its poller.
More...
#include <socket.hpp>
|
| TSocketBase (TPollerBase &poller, int domain, int type) |
|
| TSocketBase (int fd, TPollerBase &poller) |
|
int | Create (int domain, int type) |
| Creates a new socket descriptor.
|
|
int | Setup (int s) |
| Performs additional setup on the socket descriptor.
|
|
Internal base class encapsulating a socket (or file) descriptor and its poller.
This class stores a file descriptor and a pointer to a poller (TPollerBase) to support asynchronous I/O operations. It provides functionality to create a new socket descriptor (via Create()) and to set it up (via Setup()). Additionally, it holds the descriptor and allows cleanup via Close().
- Note
- This class is intended solely for internal use within the library. End-users should not interact directly with this class; instead, use the higher-level wrapper classes: TSocket, TFileHandle, TPollerDrivenSocket, or TPollerDrivenFileHandle.
◆ Create()
Creates a new socket descriptor.
- Parameters
-
domain | The protocol family of the socket. |
type | The type of socket. |
- Returns
- The socket descriptor on success, or -1 on failure.
◆ Poller()
Returns the poller associated with this socket.
- Returns
- A pointer to the TPollerBase responsible for managing asynchronous events.
◆ Setup()
Performs additional setup on the socket descriptor.
This method may set socket options and configure the descriptor as needed.
- Parameters
-
s | The socket descriptor to set up. |
- Returns
- A status code indicating success or failure.
The documentation for this class was generated from the following files: