52 void Read(
int fd,
void* buf,
int size, std::coroutine_handle<> handle);
61 void Write(
int fd,
const void* buf,
int size, std::coroutine_handle<> handle);
70 void Recv(
int fd,
void* buf,
int size, std::coroutine_handle<> handle);
79 void Send(
int fd,
const void* buf,
int size, std::coroutine_handle<> handle);
88 void Accept(
int fd,
struct sockaddr* addr, socklen_t* len, std::coroutine_handle<> handle);
97 void Connect(
int fd,
const sockaddr* addr, socklen_t len, std::coroutine_handle<> handle);
125 OVERLAPPED overlapped;
127 struct sockaddr* addr =
nullptr;
128 socklen_t* len =
nullptr;
132 memset(&overlapped, 0,
sizeof(overlapped));
143 TArenaAllocator<TIO> Allocator_;
144 std::vector<OVERLAPPED_ENTRY> Entries_;
145 std::queue<int> Results_;
void Register(int fd)
Registers a file descriptor with the IOCP.
void Recv(int fd, void *buf, int size, std::coroutine_handle<> handle)
Posts an asynchronous receive operation.
void Cancel(int fd)
Cancels all pending operations on the specified file descriptor.
NNet::TPollerDrivenSocket< TIOCp > TSocket
Alias for the poller-driven socket type.
Definition iocp.hpp:38
void Accept(int fd, struct sockaddr *addr, socklen_t *len, std::coroutine_handle<> handle)
Posts an asynchronous accept operation.
NNet::TPollerDrivenFileHandle< TIOCp > TFileHandle
Alias for the poller-driven file handle type.
Definition iocp.hpp:40
void Send(int fd, const void *buf, int size, std::coroutine_handle<> handle)
Posts an asynchronous send operation.
void Poll()
Polls for IOCP events.
void Read(int fd, void *buf, int size, std::coroutine_handle<> handle)
Posts an asynchronous read operation.
void Connect(int fd, const sockaddr *addr, socklen_t len, std::coroutine_handle<> handle)
Posts an asynchronous connect operation.
int Result()
Retrieves the result of the last completed IOCP operation.
void Write(int fd, const void *buf, int size, std::coroutine_handle<> handle)
Posts an asynchronous write operation.
TPollerBase()=default
Default constructor.
Asynchronous file handle driven by the poller's implementation.
Definition socket.hpp:742
Socket type driven by the poller's implementation.
Definition socket.hpp:519