summaryrefslogtreecommitdiffstats
path: root/utils/src/ping_client.cc
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-01-31 10:36:54 +0100
committerAngelo Mantellini <manangel@cisco.com>2019-01-31 11:17:49 +0100
commit7b61129b2ed89d2cc3ca5560f55c26c6c347a215 (patch)
tree5c2433fdcc0447f05f79a981a6e8287e61182038 /utils/src/ping_client.cc
parent67371907c2433f5233d4a669a1c9176539e9928f (diff)
[HICN-20] This source upgrade allows to compile ping_client, ping_server and hiperf (utils folder) in Windows.
Change-Id: I8253aa9aa640644b0daffd95dff202956371d814 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'utils/src/ping_client.cc')
-rw-r--r--utils/src/ping_client.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/utils/src/ping_client.cc b/utils/src/ping_client.cc
index 24f7bd7c9..a99652b9c 100644
--- a/utils/src/ping_client.cc
+++ b/utils/src/ping_client.cc
@@ -76,10 +76,10 @@ class Configuration {
class Client : interface::BasePortal::ConsumerCallback {
public:
- Client(Configuration *c)
+ Client(Configuration *c)
: portal_(),
- signals_(portal_.getIoService(), SIGINT, SIGQUIT) {
- // Let the main thread to catch SIGINT and SIGQUIT
+ signals_(portal_.getIoService(), SIGINT) {
+ // Let the main thread to catch SIGINT
portal_.connect();
portal_.setConsumerCallback(this);
@@ -341,6 +341,12 @@ void help() {
}
int main(int argc, char *argv[]) {
+
+#ifdef _WIN32
+ WSADATA wsaData = { 0 };
+ WSAStartup(MAKEWORD(2, 2), &wsaData);
+#endif
+
Configuration *c = new Configuration();
int opt;
std::string producer_certificate = "";
@@ -419,6 +425,9 @@ int main(int argc, char *argv[]) {
<< std::chrono::duration_cast<std::chrono::microseconds>(t1 - t0).count()
<< std::endl;
+#ifdef _WIN32
+ WSACleanup();
+#endif
return 0;
}