Add some function declaration comments to explain usage
This commit is contained in:
parent
1bb7c50699
commit
d02e72c6f1
@ -62,6 +62,9 @@ static char *server = NULL;
|
|||||||
static int desired = 0; /* Number of desired connections */
|
static int desired = 0; /* Number of desired connections */
|
||||||
static int port = 0;
|
static int port = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Frees the linked list of active event structures
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
cleanup()
|
cleanup()
|
||||||
{
|
{
|
||||||
@ -76,6 +79,10 @@ cleanup()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Signal handler callback to be executed by event_dispatch upon receipt of
|
||||||
|
* SIGINT (usually Control-C
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
sigint_exit(int fd, short event, void *arg)
|
sigint_exit(int fd, short event, void *arg)
|
||||||
{
|
{
|
||||||
@ -101,6 +108,13 @@ sigint_exit(int fd, short event, void *arg)
|
|||||||
cleanup();
|
cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Connection disconnect handler. Once a connection is dropped by the remote
|
||||||
|
* host, this function is executed and a new connection is established.
|
||||||
|
*
|
||||||
|
* Note, that this re-uses the event structure originally allocated in
|
||||||
|
* dns_lookup_callback
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
reconnect(int sd, short event, void *arg)
|
reconnect(int sd, short event, void *arg)
|
||||||
{
|
{
|
||||||
@ -132,6 +146,9 @@ reconnect(int sd, short event, void *arg)
|
|||||||
/*
|
/*
|
||||||
* For the explanation of these parameters, please refer to the libevent evdns
|
* For the explanation of these parameters, please refer to the libevent evdns
|
||||||
* callback API
|
* callback API
|
||||||
|
*
|
||||||
|
* Upon receipt of a valid dns lookup result, attempts to open `desired`
|
||||||
|
* connections and allocates memory for the associated event structures
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
dns_lookup_callback(int result, char type, int count, int ttl, void *addresses,
|
dns_lookup_callback(int result, char type, int count, int ttl, void *addresses,
|
||||||
|
Loading…
Reference in New Issue
Block a user