uvco 0.1
|
Classes | |
struct | PollCtx |
A uv poll handle with its associated CurlRequest_. More... | |
Public Member Functions | |
UvCurlContext_ (const Loop &loop) | |
UvCurlContext_ (const UvCurlContext_ &)=delete | |
UvCurlContext_ (UvCurlContext_ &&)=delete | |
UvCurlContext_ & | operator= (const UvCurlContext_ &)=delete |
UvCurlContext_ & | operator= (UvCurlContext_ &&)=delete |
~UvCurlContext_ () | |
void | addHandle (CURL *handle) |
Add a Curl easy handle to the multi handle. | |
void | removeHandle (CURL *handle) |
Remove a Curl easy handle from the multi handle. | |
void | checkCurlInfo () const |
Checks with Curl for any completed/errored requests. | |
void | initPoll (CurlRequestCore_ *request, curl_socket_t newSocket) noexcept |
void | uvStartPoll (curl_socket_t socket, unsigned int events) noexcept |
void | uvStopPoll (curl_socket_t socket) noexcept |
CurlRequestCore_ & | getRequest (curl_socket_t socket) |
Promise< void > | close () |
Close all open sockets and the timer. | |
Static Public Member Functions | |
static int | curlSocketFunction (CURL *easy, curl_socket_t socket, int action, void *userp, void *) |
static int | curlTimerFunction (CURLM *, long timeoutMs, void *userp) |
Called by Curl to inform us of a timeout to set up. | |
static void | onUvTimeout (uv_timer_t *timer) |
Called by libuv when a timeout timer expires. | |
static void | onCurlSocketActive (uv_poll_t *poll, int status, int events) |
Called by libuv when there is activity on a curl socket. | |
Private Attributes | |
CURLM * | multi_ |
uv_loop_t * | loop_ |
uv_timer_t | timer_ |
std::map< curl_socket_t, PollCtx > | polls_ |
Contains references to the libcurl multi handle and the libuv loop. Only valid as long as one loop instance is running. Used as context for curl socket functions (SOCKETDATA) and timer functions (TIMERDATA).
|
explicit |
|
delete |
|
delete |
|
inline |
|
inline |
void uvco::UvCurlContext_::checkCurlInfo | ( | ) | const |
Checks with Curl for any completed/errored requests.
|
inline |
Close all open sockets and the timer.
|
static |
Called by Curl to inform us of a new socket to monitor or a socket to be removed.
|
static |
Called by Curl to inform us of a timeout to set up.
|
inline |
Returns the CurlRequest associated with the given socket. This is essential for notifying individual requests of socket errors; socket errors occur in a uv callbcak which only has access to the socket.
|
inlinenoexcept |
|
static |
Called by libuv when there is activity on a curl socket.
|
static |
Called by libuv when a timeout timer expires.
|
delete |
|
delete |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
private |
|
private |
|
private |
|
private |