diff --git a/demo/async/CMakeLists.txt b/demo/async/CMakeLists.txt index 614bcfc3b..ef9311bf1 100644 --- a/demo/async/CMakeLists.txt +++ b/demo/async/CMakeLists.txt @@ -7,7 +7,7 @@ # file was obtained (LICENSE.txt). A copy of the license may also be # found online at https://opensource.org/licenses/MIT. -cmake_minimum_required (VERSION 2.8.7) +cmake_minimum_required (VERSION 2.8.12) project(nng-asyncdemo) @@ -16,9 +16,12 @@ set(PARALLEL 128 CACHE STRING "Parallelism (min 4, max 1000)") # Call this from your own project's makefile. find_package(nng CONFIG REQUIRED) +find_package(Threads) + add_executable(server server.c) target_link_libraries(server nng::nng) -target_compile_definitions(server PRIVATE -DPARALLEL=${PARALLEL}) +target_compile_definitions(server PRIVATE NNG_ELIDE_DEPRECATED PARALLEL=${PARALLEL}) add_executable(client client.c) target_link_libraries(client nng::nng) +target_compile_definitions(client PRIVATE NNG_ELIDE_DEPRECATED) diff --git a/demo/http_client/CMakeLists.txt b/demo/http_client/CMakeLists.txt index 3fe126f94..8f4b62f4a 100644 --- a/demo/http_client/CMakeLists.txt +++ b/demo/http_client/CMakeLists.txt @@ -7,12 +7,15 @@ # file was obtained (LICENSE.txt). A copy of the license may also be # found online at https://opensource.org/licenses/MIT. -cmake_minimum_required (VERSION 2.8.7) +cmake_minimum_required (VERSION 2.8.12) project(http_client) # Call this from your own project's makefile. find_package(nng CONFIG REQUIRED) +find_package(Threads) + add_executable(http_client http_client.c) target_link_libraries(http_client nng::nng) +target_compile_definitions(http_client PRIVATE NNG_ELIDE_DEPRECATED) diff --git a/demo/raw/CMakeLists.txt b/demo/raw/CMakeLists.txt index 15e481d57..2df8d3946 100644 --- a/demo/raw/CMakeLists.txt +++ b/demo/raw/CMakeLists.txt @@ -7,7 +7,7 @@ # file was obtained (LICENSE.txt). A copy of the license may also be # found online at https://opensource.org/licenses/MIT. -cmake_minimum_required (VERSION 2.8.7) +cmake_minimum_required (VERSION 2.8.12) project(raw) @@ -15,6 +15,8 @@ set(PARALLEL 128 CACHE STRING "Parallelism (min 4, max 1000)") find_package(nng CONFIG REQUIRED) +find_package(Threads) + add_executable(raw raw.c) target_link_libraries(raw nng::nng) -target_compile_definitions(raw PRIVATE -DPARALLEL=${PARALLEL}) +target_compile_definitions(raw PRIVATE NNG_ELIDE_DEPRECATED PARALLEL=${PARALLEL}) diff --git a/demo/reqrep/CMakeLists.txt b/demo/reqrep/CMakeLists.txt index c7a258b0c..092346466 100644 --- a/demo/reqrep/CMakeLists.txt +++ b/demo/reqrep/CMakeLists.txt @@ -7,7 +7,7 @@ # file was obtained (LICENSE.txt). A copy of the license may also be # found online at https://opensource.org/licenses/MIT. -cmake_minimum_required (VERSION 2.8.7) +cmake_minimum_required (VERSION 2.8.12) project(reqrep) @@ -20,3 +20,4 @@ find_package(Threads) add_executable(reqrep reqrep.c) target_link_libraries(reqrep nng::nng) +target_compile_definitions(reqrep PRIVATE NNG_ELIDE_DEPRECATED) diff --git a/demo/reqrep/reqrep.c b/demo/reqrep/reqrep.c index 3fccf6886..62ff29a48 100644 --- a/demo/reqrep/reqrep.c +++ b/demo/reqrep/reqrep.c @@ -88,15 +88,15 @@ server(const char *url) if (strncmp(url, "zt://", 5) == 0) { printf("ZeroTier transport will store its keys in current working directory.\n"); printf("The server and client instances must run in separate directories.\n"); - nng_listener_setopt_string(listener, NNG_OPT_ZT_HOME, "."); - nng_listener_setopt_ms(listener, NNG_OPT_RECONNMINT, 1); - nng_listener_setopt_ms(listener, NNG_OPT_RECONNMAXT, 1000); - nng_setopt_ms(sock, NNG_OPT_REQ_RESENDTIME, 2000); - nng_setopt_ms(sock, NNG_OPT_RECVMAXSZ, 0); - nng_listener_setopt_ms(listener, NNG_OPT_ZT_PING_TIME, 10000); - nng_listener_setopt_ms(listener, NNG_OPT_ZT_CONN_TIME, 1000); + nng_listener_set_string(listener, NNG_OPT_ZT_HOME, "."); + nng_listener_set_ms(listener, NNG_OPT_RECONNMINT, 1); + nng_listener_set_ms(listener, NNG_OPT_RECONNMAXT, 1000); + nng_socket_set_ms(sock, NNG_OPT_REQ_RESENDTIME, 2000); + nng_socket_set_ms(sock, NNG_OPT_RECVMAXSZ, 0); + nng_listener_set_ms(listener, NNG_OPT_ZT_PING_TIME, 10000); + nng_listener_set_ms(listener, NNG_OPT_ZT_CONN_TIME, 1000); } else { - nng_setopt_ms(sock, NNG_OPT_REQ_RESENDTIME, 2000); + nng_socket_set_ms(sock, NNG_OPT_REQ_RESENDTIME, 2000); } nng_listener_start(listener, 0); @@ -158,15 +158,15 @@ client(const char *url) if (strncmp(url, "zt://", 5) == 0) { printf("ZeroTier transport will store its keys in current working directory\n"); printf("The server and client instances must run in separate directories.\n"); - nng_dialer_setopt_string(dialer, NNG_OPT_ZT_HOME, "."); - nng_dialer_setopt_ms(dialer, NNG_OPT_RECONNMINT, 1); - nng_dialer_setopt_ms(dialer, NNG_OPT_RECONNMAXT, 1000); - nng_setopt_ms(sock, NNG_OPT_REQ_RESENDTIME, 2000); - nng_setopt_ms(sock, NNG_OPT_RECVMAXSZ, 0); - nng_dialer_setopt_ms(dialer, NNG_OPT_ZT_PING_TIME, 10000); - nng_dialer_setopt_ms(dialer, NNG_OPT_ZT_CONN_TIME, 1000); + nng_dialer_set_string(dialer, NNG_OPT_ZT_HOME, "."); + nng_dialer_set_ms(dialer, NNG_OPT_RECONNMINT, 1); + nng_dialer_set_ms(dialer, NNG_OPT_RECONNMAXT, 1000); + nng_socket_set_ms(sock, NNG_OPT_REQ_RESENDTIME, 2000); + nng_socket_set_ms(sock, NNG_OPT_RECVMAXSZ, 0); + nng_dialer_set_ms(dialer, NNG_OPT_ZT_PING_TIME, 10000); + nng_dialer_set_ms(dialer, NNG_OPT_ZT_CONN_TIME, 1000); } else { - nng_setopt_ms(sock, NNG_OPT_REQ_RESENDTIME, 2000); + nng_socket_set_ms(sock, NNG_OPT_REQ_RESENDTIME, 2000); } nng_dialer_start(dialer, NNG_FLAG_NONBLOCK); diff --git a/demo/rest/CMakeLists.txt b/demo/rest/CMakeLists.txt index 5466e3c7f..d5dd4fe4a 100644 --- a/demo/rest/CMakeLists.txt +++ b/demo/rest/CMakeLists.txt @@ -7,11 +7,14 @@ # file was obtained (LICENSE.txt). A copy of the license may also be # found online at https://opensource.org/licenses/MIT. -cmake_minimum_required (VERSION 2.8.7) +cmake_minimum_required (VERSION 2.8.12) project(rest) find_package(nng CONFIG REQUIRED) +find_package(Threads) + add_executable(rest-server server.c) target_link_libraries(rest-server nng::nng) +target_compile_definitions(rest-server PRIVATE NNG_ELIDE_DEPRECATED)