diff options
author | Angelo Mantellini <manangel@cisco.com> | 2019-01-31 10:36:54 +0100 |
---|---|---|
committer | Angelo Mantellini <manangel@cisco.com> | 2019-01-31 11:17:49 +0100 |
commit | 7b61129b2ed89d2cc3ca5560f55c26c6c347a215 (patch) | |
tree | 5c2433fdcc0447f05f79a981a6e8287e61182038 /utils/src/ping_client.cc | |
parent | 67371907c2433f5233d4a669a1c9176539e9928f (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.cc | 15 |
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; } |