|
| | TPollerDrivenFileHandle (int fd, T &poller) |
| | Constructs a TPollerDrivenFileHandle from an existing file descriptor.
|
| |
| auto | ReadSome (void *buf, size_t size) |
| | Asynchronously reads data from the file into the provided buffer.
|
| |
| auto | WriteSome (const void *buf, size_t size) |
| | Asynchronously writes data from the provided buffer to the file.
|
| |
|
auto | WriteSomeYield (const void *buf, size_t size) |
| | The WriteSomeYield and ReadSomeYield variants behave similarly to WriteSome/ReadSome.
|
| |
|
auto | ReadSomeYield (void *buf, size_t size) |
| | The WriteSomeYield and ReadSomeYield variants behave similarly to WriteSome/ReadSome.
|
| |
Public Member Functions inherited from NNet::TFileHandle |
| | TFileHandle (int fd, TPollerBase &poller) |
| | Constructs a TFileHandle from an existing file descriptor.
|
| |
|
| TFileHandle (TFileHandle &&other) |
| |
|
TFileHandle & | operator= (TFileHandle &&other) |
| |
| auto | ReadSome (void *buf, size_t size) |
| | Asynchronously reads data from the socket into the provided buffer.
|
| |
| auto | ReadSomeYield (void *buf, size_t size) |
| | Forces a read operation on the next event loop iteration.
|
| |
| auto | WriteSome (const void *buf, size_t size) |
| | Asynchronously writes data from the provided buffer to the socket.
|
| |
| auto | WriteSomeYield (const void *buf, size_t size) |
| | Forces a write operation on the next event loop iteration.
|
| |
| auto | Monitor () |
| | Monitors the socket for remote hang-up (closure).
|
| |
| void | Close () |
| | Closes the socket.
|
| |
template<typename T>
class NNet::TPollerDrivenFileHandle< T >
Asynchronous file handle driven by the poller's implementation.
This class implements file I/O operations (e.g. read, write) using methods provided by the poller. In such scenarios, the poller controls the behavior of these operations (for example, when using io_uring on Linux or IOCP on Windows).
Ordinary users should not choose a file handle type directly. Instead, they should use the type defined by the poller (i.e. typename TPoller::TFileHandle), which will resolve to either TFileHandle or TPollerDrivenFileHandle depending on the poller in use.
- Template Parameters
-
| T | The poller type that defines the asynchronous file operations. |