From a39278f7beee15ca66b02b2422dea6afa18ff0e4 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Mon, 31 Dec 2018 12:47:42 -0800 Subject: [PATCH] add a print statement when the connection is closed / still need to terminate server thread --- examples/echo_server/echo_server.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/echo_server/echo_server.cpp b/examples/echo_server/echo_server.cpp index 1d35808d..5a9e879a 100644 --- a/examples/echo_server/echo_server.cpp +++ b/examples/echo_server/echo_server.cpp @@ -33,13 +33,17 @@ int main(int argc, char** argv) { if (messageType == ix::WebSocket_MessageType_Open) { - std::cout << "New connection" << std::endl; - std::cout << "Headers:" << std::endl; + std::cerr << "New connection" << std::endl; + std::cerr << "Headers:" << std::endl; for (auto it : headers) { std::cerr << it.first << ": " << it.second << std::endl; } } + else if (messageType == ix::WebSocket_MessageType_Close) + { + std::cerr << "Closed connection" << std::endl; + } else if (messageType == ix::WebSocket_MessageType_Message) { std::cerr << str << std::endl;