diff --git a/examples/broadcast_server_tls/Makefile b/examples/broadcast_server_tls/Makefile index 8ab28c4dc5..01804900b9 100644 --- a/examples/broadcast_server_tls/Makefile +++ b/examples/broadcast_server_tls/Makefile @@ -1,4 +1,4 @@ -BOOST_LIBS=boost_system boost_date_time boost_regex +BOOST_LIBS=boost_system boost_date_time boost_regex boost_thread include ../common.mk diff --git a/examples/chat_client/Makefile b/examples/chat_client/Makefile index 6cd68f70b6..a2162bdeab 100644 --- a/examples/chat_client/Makefile +++ b/examples/chat_client/Makefile @@ -2,6 +2,8 @@ BOOST_LIBS=boost_system boost_thread boost_regex boost_random include ../common.mk +LDFLAGS := $(LDFLAGS) -lpthread + chat_client: chat_client.o chat_client_handler.o $(CXX) $(CFLAGS) $^ -o $@ $(LDFLAGS) diff --git a/examples/fuzzing_client/Makefile b/examples/fuzzing_client/Makefile index f62538d8dd..c757815aeb 100644 --- a/examples/fuzzing_client/Makefile +++ b/examples/fuzzing_client/Makefile @@ -2,6 +2,8 @@ BOOST_LIBS=boost_system boost_date_time boost_thread boost_regex boost_random include ../common.mk +LDFLAGS := $(LDFLAGS) -lpthread + fuzzing_client: fuzzing_client.o $(CXX) $(CFLAGS) $^ -o $@ $(LDFLAGS) diff --git a/examples/fuzzing_server_tls/Makefile b/examples/fuzzing_server_tls/Makefile index ec9e841446..761cc10a0f 100644 --- a/examples/fuzzing_server_tls/Makefile +++ b/examples/fuzzing_server_tls/Makefile @@ -1,4 +1,4 @@ -BOOST_LIBS=boost_system boost_date_time boost_regex +BOOST_LIBS=boost_system boost_date_time boost_regex boost_thread include ../common.mk diff --git a/examples/stress_client/stress_client.cpp b/examples/stress_client/stress_client.cpp index 95cf17eb15..1df66f088d 100644 --- a/examples/stress_client/stress_client.cpp +++ b/examples/stress_client/stress_client.cpp @@ -138,8 +138,8 @@ private: m_msg_stats.clear(); } - int m_connections_max; - int m_connections_cur; + unsigned int m_connections_max; + unsigned int m_connections_cur; std::map m_msg_stats; boost::shared_ptr m_timer; }; @@ -150,14 +150,16 @@ int main(int argc, char* argv[]) { int num_connections = 100; int batch_size = 25; int delay_ms = 16; - - if (argc != 5) { - std::cout << "Usage: `echo_client test_url num_connections batch_size delay_ms`" << std::endl; - } else { - uri = argv[1]; - num_connections = atoi(argv[2]); - batch_size = atoi(argv[3]); - delay_ms = atoi(argv[4]); + + if (argc > 1) { + if (argc != 5) { + std::cout << "Usage: `echo_client test_url num_connections batch_size delay_ms`" << std::endl; + } else { + uri = argv[1]; + num_connections = atoi(argv[2]); + batch_size = atoi(argv[3]); + delay_ms = atoi(argv[4]); + } } // 12288 is max OS X limit without changing kernal settings @@ -209,7 +211,7 @@ int main(int argc, char* argv[]) { connections.insert(endpoint.connect(uri)); - boost::thread t(boost::bind(&plain_endpoint_type::run, &endpoint)); + boost::thread t(boost::bind(&plain_endpoint_type::run, &endpoint, false)); std::cout << "launching " << num_connections << " connections to " << uri << " in batches of " << batch_size << std::endl; diff --git a/src/endpoint.hpp b/src/endpoint.hpp index 252dff14e3..f9ac5a582b 100644 --- a/src/endpoint.hpp +++ b/src/endpoint.hpp @@ -237,7 +237,7 @@ public: boost::lock_guard lock(m_lock); if (!new_handler) { - elog()->at(log::elevel::FATAL) + elog().at(log::elevel::FATAL) << "Tried to switch to a NULL handler." << log::endl; throw websocketpp::exception("TODO: handlers can't be null"); } diff --git a/src/rng/boost_rng.hpp b/src/rng/boost_rng.hpp index 2513163910..8069937080 100644 --- a/src/rng/boost_rng.hpp +++ b/src/rng/boost_rng.hpp @@ -30,7 +30,9 @@ #ifndef BOOST_RNG_HPP #define BOOST_RNG_HPP +#define __STDC_LIMIT_MACROS 1 #include + #include #include