Asynchronous file handle that owns its file descriptor. More...
#include <socket.hpp>
Public Member Functions | |
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. | |
Additional Inherited Members | |
![]() | |
TSocketBase (TPollerBase &poller, int domain, int type) | |
Constructs a TSocketBase with a new socket descriptor. | |
TSocketBase (int fd, TPollerBase &poller) | |
Constructs a TSocketBase from an existing socket descriptor. | |
TSocketBase (const TSocketBase &other)=delete | |
TSocketBase & | operator= (TSocketBase &other) const=delete |
Asynchronous file handle that owns its file descriptor.
The passed file descriptor is owned by TFileHandle and will be closed automatically when the object is destroyed.
|
inline |
Constructs a TFileHandle from an existing file descriptor.
fd | The file descriptor to be managed. |
poller | Reference to a poller for asynchronous operations. |