Alien-cares
view release on metacpan or search on metacpan
libcares/CHANGES.0 view on Meta::CPAN
* September 28 2007 (Daniel Stenberg)
- Bumped version to 1.5.0 for next release and soname bumped to 2 due to ABI
and API changes in the progress callback (and possibly more coming up from
Steinar)
* September 28 2007 (Steinar H. Gunderson)
- Don't skip a server if it's the only one. (Bugfix from the Google tree.)
- Made the query callbacks receive the number of timeouts that happened during
the execution of a query, and updated documentation accordingly. (Patch from
the Google tree.)
- Support a few more socket options: ARES_OPT_SOCK_SNDBUF and
ARES_OPT_SOCK_RCVBUF
- Always register for TCP events even if there are no outstanding queries, as
the other side could always close the connection, which is a valid event
which should be responded to.
libcares/ares_cancel.3 view on Meta::CPAN
ares_cancel \- Cancel a resolve
.SH SYNOPSIS
.nf
#include <ares.h>
void ares_cancel(ares_channel \fIchannel\fP)
.fi
.SH DESCRIPTION
The \fBares_cancel(3)\fP function cancels all lookups/requests made on the the
name service channel identified by \fIchannel\fP. \fBares_cancel(3)\fP
invokes the callbacks for each pending query on the channel, passing a status
of
.BR ARES_ECANCELLED .
These calls give the callbacks a chance to clean up any state which might have
been stored in their arguments. If such a callback invocation adds a new
request to the channel, that request will \fInot\fP be cancelled by the
current invocation of \fBares_cancel(3)\fP.
.SH SEE ALSO
.BR ares_init (3)
.BR ares_destroy (3)
.SH NOTES
This function was added in c-ares 1.2.0
c-ares 1.6.0 and earlier pass a status of
libcares/ares_cancel.c view on Meta::CPAN
{
struct query *query;
struct list_node list_head_copy;
struct list_node* list_head;
struct list_node* list_node;
int i;
if (!ares__is_list_empty(&(channel->all_queries)))
{
/* Swap list heads, so that only those queries which were present on entry
* into this function are cancelled. New queries added by callbacks of
* queries being cancelled will not be cancelled themselves.
*/
list_head = &(channel->all_queries);
list_head_copy.prev = list_head->prev;
list_head_copy.next = list_head->next;
list_head_copy.prev->next = &list_head_copy;
list_head_copy.next->prev = &list_head_copy;
list_head->prev = list_head;
list_head->next = list_head;
for (list_node = list_head_copy.next; list_node != &list_head_copy; )
libcares/ares_destroy.3 view on Meta::CPAN
.nf
#include <ares.h>
void ares_destroy(ares_channel \fIchannel\fP)
.fi
.SH DESCRIPTION
The \fBares_destroy(3)\fP function destroys the name service channel
identified by \fIchannel\fP, freeing all memory and closing all sockets used
by the channel.
\fBares_destroy(3)\fP invokes the callbacks for each pending query on the
channel, passing a status of \fIARES_EDESTRUCTION\fP. These calls give the
callbacks a chance to clean up any state which might have been stored in their
arguments. A callback must not add new requests to a channel being destroyed.
.SH SEE ALSO
.BR ares_init (3),
.BR ares_cancel (3)
.SH AUTHOR
Greg Hudson, MIT Information Systems
.br
Copyright 1998 by the Massachusetts Institute of Technology.
libcares/ares_process.3 view on Meta::CPAN
.SH DESCRIPTION
The \fBares_process(3)\fP function handles input/output events and timeouts
associated with queries pending on the name service channel identified by
.IR channel .
The file descriptor sets pointed to by \fIread_fds\fP and \fIwrite_fds\fP
should have file descriptors set in them according to whether the file
descriptors specified by \fIares_fds(3)\fP are ready for reading and writing.
(The easiest way to determine this information is to invoke \fBselect(3)\fP
with a timeout no greater than the timeout given by \fIares_timeout(3)\fP).
The \fBares_process(3)\fP function will invoke callbacks for pending queries
if they complete successfully or fail.
\fBares_process_fd(3)\fP works the same way but acts and operates only on the
specific file descriptors (sockets) you pass in to the function. Use
ARES_SOCKET_BAD for "no action". This function is provided to allow users of
c-ares to void \fIselect(3)\fP in their applications and within c-ares.
To only process possible timeout conditions without a socket event occurring,
one may pass NULL as the values for both \fIread_fds\fP and \fIwrite_fds\fP for
\fBares_process(3)\fP, or ARES_SOCKET_BAD for both \fIread_fd\fP and
libcares/ares_set_socket_functions.3 view on Meta::CPAN
.\"
.TH ARES_SET_SOCKET_FUNCTIONS 3 "13 Dec 2016"
.SH NAME
ares_set_socket_functions \- Set socket io callbacks
.SH SYNOPSIS
.nf
.B #include <ares.h>
.PP
.B struct ares_socket_functions {
ares_socket_t(*\fIasocket\fP)(int, int, int, void *);
int(*\fIaclose\fP)(ares_socket_t, void *);
int(*\fIaconnect\fP)(ares_socket_t, const struct sockaddr *, ares_socklen_t, void *);
ares_ssize_t(*\fIarecvfrom\fP)(ares_socket_t, void *, size_t, int, struct sockaddr *, ares_socklen_t *, void *);
ares_ssize_t(*\fIasendv\fP)(ares_socket_t, const struct iovec *, int, void *);
libcares/ares_set_socket_functions.3 view on Meta::CPAN
.BR EAGAIN
or
.BR EWOULDBLOCK.
.PP
The \fIuser_data\fP value is provided to each callback function invocation to serve as
context.
.PP
The
.B ares_socket_functions
must provide the following callbacks:
.TP 18
.B \fIasocket\fP
.B ares_socket_t(*)(int \fIdomain\fP, int \fItype\fP, int \fIprotocol\fP, void * \fIuser_data\fP)
.br
Creates an endpoint for communication and returns a descriptor. \fIdomain\fP, \fItype\fP, and \fIprotocol\fP
each correspond to the parameters of
.BR socket(2).
Returns ahandle to the newly created socket, or -1 on error.
.TP 18
.B \fIaclose\fP
libcares/test/ares-test.h view on Meta::CPAN
// Whether the callback has been invoked.
bool done_;
// Explicitly provided result information.
int status_;
int timeouts_;
// Contents of the ares_addrinfo structure, if provided.
AddrInfo ai_;
};
std::ostream& operator<<(std::ostream& os, const AddrInfoResult& result);
// Standard implementation of ares callbacks that fill out the corresponding
// structures.
void HostCallback(void *data, int status, int timeouts,
struct hostent *hostent);
void SearchCallback(void *data, int status, int timeouts,
unsigned char *abuf, int alen);
void NameInfoCallback(void *data, int status, int timeouts,
char *node, char *service);
void AddrInfoCallback(void *data, int status, int timeouts,
struct ares_addrinfo *res);
libcares/test/gmock-1.8.0/gmock/gmock.h view on Meta::CPAN
// Foo(3);
// }
//
// The expectation spec says that the first Bar("a") must happen
// before check point "1", the second Bar("a") must happen after check
// point "2", and nothing should happen between the two check
// points. The explicit check points make it easy to tell which
// Bar("a") is called by which call to Foo().
//
// MockFunction<F> can also be used to exercise code that accepts
// std::function<F> callbacks. To do so, use AsStdFunction() method
// to create std::function proxy forwarding to original object's Call.
// Example:
//
// TEST(FooTest, RunsCallbackWithBarArgument) {
// MockFunction<int(string)> callback;
// EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1));
// Foo(callback.AsStdFunction());
// }
template <typename F>
class MockFunction;
( run in 0.421 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )