diff options
author | lloyd <[email protected]> | 2012-06-20 15:54:10 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-06-20 15:54:10 +0000 |
commit | d7fca253446491f0fa3985cba73fed08af9283ef (patch) | |
tree | caeb93d827a4dbb6a735afe238f5477c744fdb46 | |
parent | 8729e97de61943ebd0555b94627c7ba50704d02f (diff) |
Allow configurable # of threads, useful for scale testing
-rw-r--r-- | doc/examples/asio_tls_server.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/examples/asio_tls_server.cpp b/doc/examples/asio_tls_server.cpp index 0cf499e0a..28f499efe 100644 --- a/doc/examples/asio_tls_server.cpp +++ b/doc/examples/asio_tls_server.cpp @@ -257,7 +257,7 @@ size_t choose_thread_count() return 2; } -int main() +int main(int argc, char* argv[]) { try { @@ -267,7 +267,9 @@ int main() unsigned short port = 4434; tls_server server(io_service, port); - const size_t num_threads = choose_thread_count(); + size_t num_threads = choose_thread_count(); + if(argc == 2) + std::istringstream(argv[1]) >> num_threads; std::cout << "Using " << num_threads << " threads\n"; |