5#ifndef WPINET_UV_POLL_H_
6#define WPINET_UV_POLL_H_
24 struct private_init {};
27 explicit Poll(
const private_init&) {}
28 ~Poll() noexcept override = default;
63 static std::shared_ptr<Poll>
CreateSocket(
const std::shared_ptr<Loop>& loop,
78 void Reuse(
int fd, std::function<
void()> callback);
112 std::function<void()> callback;
117 std::unique_ptr<ReuseData> m_reuseData;
SignalBase is an implementation of the observer pattern, through the use of an emitting object and sl...
Definition: Signal.h:495
bool Invoke(F &&f, Args &&... args) const
Definition: Handle.h:251
Handle.
Definition: Handle.h:273
uv_poll_t * GetRaw() const noexcept
Get the underlying handle data structure.
Definition: Handle.h:288
Event loop.
Definition: Loop.h:37
Poll handle.
Definition: Poll.h:23
sig::Signal< int > pollEvent
Signal generated when a poll event occurs.
Definition: Poll.h:108
~Poll() noexcept override=default
void Start(int events)
Start polling the file descriptor.
static std::shared_ptr< Poll > CreateSocket(Loop &loop, uv_os_sock_t sock)
Create a poll handle using a socket descriptor.
void ReuseSocket(uv_os_sock_t sock, std::function< void()> callback)
Reuse this handle.
Poll(const private_init &)
Definition: Poll.h:27
static std::shared_ptr< Poll > CreateSocket(const std::shared_ptr< Loop > &loop, uv_os_sock_t sock)
Create a poll handle using a socket descriptor.
Definition: Poll.h:63
static std::shared_ptr< Poll > Create(Loop &loop, int fd)
Create a poll handle using a file descriptor.
void Reuse(int fd, std::function< void()> callback)
Reuse this handle.
void Stop()
Stop polling the file descriptor.
Definition: Poll.h:103
Definition: StdDeque.h:50
Definition: ParallelTcpConnector.h:22
UV_EXTERN int uv_poll_stop(uv_poll_t *handle)
SOCKET uv_os_sock_t
Definition: win.h:240