COROIO: NNet::TFileHandle Class Reference
COROIO
 
Loading...
Searching...
No Matches
NNet::TFileHandle Class Reference

Asynchronous file handle that owns its file descriptor. More...

#include <socket.hpp>

Inheritance diagram for NNet::TFileHandle:
NNet::TSocketBase< TFileOps > NNet::TPollerDrivenFileHandle< TIOCp > NNet::TPollerDrivenFileHandle< TUring > NNet::TPollerDrivenFileHandle< T >

Public Member Functions

 TFileHandle (int fd, TPollerBase &poller)
 Constructs a TFileHandle from an existing file descriptor.
 
 TFileHandle (TFileHandle &&other)
 
TFileHandleoperator= (TFileHandle &&other)
 
- Public Member Functions inherited from NNet::TSocketBase< TFileOps >
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

- Protected Member Functions inherited from NNet::TSocketBase< TFileOps >
 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
 
TSocketBaseoperator= (TSocketBase &other) const=delete
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TFileHandle()

NNet::TFileHandle::TFileHandle ( int fd,
TPollerBase & poller )
inline

Constructs a TFileHandle from an existing file descriptor.

Parameters
fdThe file descriptor to be managed.
pollerReference to a poller for asynchronous operations.

The documentation for this class was generated from the following file: