From 7b61129b2ed89d2cc3ca5560f55c26c6c347a215 Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Thu, 31 Jan 2019 10:36:54 +0100 Subject: [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 --- utils/src/ping_client.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'utils/src/ping_client.cc') 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(t1 - t0).count() << std::endl; +#ifdef _WIN32 + WSACleanup(); +#endif return 0; } -- cgit 1.2.3-korg