aboutsummaryrefslogtreecommitdiffstats
path: root/docs/examples/asiohiper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/asiohiper.cpp')
-rw-r--r--docs/examples/asiohiper.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/examples/asiohiper.cpp b/docs/examples/asiohiper.cpp
index eb5cd038..d6065e55 100644
--- a/docs/examples/asiohiper.cpp
+++ b/docs/examples/asiohiper.cpp
@@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2012 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2012 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,11 +20,11 @@
*
***************************************************************************/
+/* <DESC>
+ * demonstrate the use of multi socket interface with boost::asio
+ * </DESC>
+ */
/*
- * file: asiohiper.cpp
- * Example program to demonstrate the use of multi socket interface
- * with boost::asio
- *
* This program is in c++ and uses boost::asio instead of libevent/libev.
* Requires boost::asio, boost::bind and boost::system
*
@@ -48,6 +48,7 @@
#include <curl/curl.h>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
+#include <iostream>
#define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */
@@ -378,9 +379,9 @@ static curl_socket_t opensocket(void *clientp, curlsocktype purpose,
}
/* CURLOPT_CLOSESOCKETFUNCTION */
-static int closesocket(void *clientp, curl_socket_t item)
+static int close_socket(void *clientp, curl_socket_t item)
{
- fprintf(MSG_OUT, "\nclosesocket : %d", item);
+ fprintf(MSG_OUT, "\nclose_socket : %d", item);
std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(item);
@@ -427,7 +428,7 @@ static void new_conn(char *url, GlobalInfo *g)
curl_easy_setopt(conn->easy, CURLOPT_OPENSOCKETFUNCTION, opensocket);
/* call this function to close a socket */
- curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, closesocket);
+ curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, close_socket);
fprintf(MSG_OUT,
"\nAdding easy %p to multi %p (%s)", conn->easy, g->multi, url);
@@ -441,7 +442,6 @@ static void new_conn(char *url, GlobalInfo *g)
int main(int argc, char **argv)
{
GlobalInfo g;
- CURLMcode rc;
(void)argc;
(void)argv;