From 55a92c28cd531a697a9732b252609646d973106c Mon Sep 17 00:00:00 2001 From: lganzzzo Date: Sun, 26 Jan 2020 00:39:17 +0700 Subject: [PATCH] Update to the latest oatpp API version --- client/CMakeLists.txt | 4 ++-- client/src/ClientSocketListener.hpp | 4 ++-- server/CMakeLists.txt | 4 ++-- server/src/controller/WebSocketListener.hpp | 4 ++-- server/test/WebSocketTest.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 3a50996..7855148 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -18,8 +18,8 @@ add_library(${project_name}-lib ## link libs -find_package(oatpp 0.19.12 REQUIRED) -find_package(oatpp-websocket 0.19.12 REQUIRED) +find_package(oatpp 1.0.0 REQUIRED) +find_package(oatpp-websocket 1.0.0 REQUIRED) target_link_libraries(${project_name}-lib PUBLIC oatpp::oatpp diff --git a/client/src/ClientSocketListener.hpp b/client/src/ClientSocketListener.hpp index 4403c4f..1c45a19 100644 --- a/client/src/ClientSocketListener.hpp +++ b/client/src/ClientSocketListener.hpp @@ -55,7 +55,7 @@ class ClientSocketListener : public oatpp::websocket::AsyncWebSocket::Listener{ /** * Called on "close" frame */ - CoroutineStarter onClose(const std::shared_ptr& socket, v_word16 code, const oatpp::String& message) override { + CoroutineStarter onClose(const std::shared_ptr& socket, v_uint16 code, const oatpp::String& message) override { ++ FRAMES; return nullptr; // do nothing } @@ -63,7 +63,7 @@ class ClientSocketListener : public oatpp::websocket::AsyncWebSocket::Listener{ /** * Called on each message frame. After the last message will be called once-again with size == 0 to designate end of the message. */ - CoroutineStarter readMessage(const std::shared_ptr& socket, v_word8 opcode, p_char8 data, oatpp::v_io_size size) override { + CoroutineStarter readMessage(const std::shared_ptr& socket, v_uint8 opcode, p_char8 data, oatpp::v_io_size size) override { if(size == 0) { // message transfer finished diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 2ed0789..2b55cf1 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -19,8 +19,8 @@ add_library(${project_name}-lib ## link libs -find_package(oatpp 0.19.12 REQUIRED) -find_package(oatpp-websocket 0.19.12 REQUIRED) +find_package(oatpp 1.0.0 REQUIRED) +find_package(oatpp-websocket 1.0.0 REQUIRED) target_link_libraries(${project_name}-lib PUBLIC oatpp::oatpp diff --git a/server/src/controller/WebSocketListener.hpp b/server/src/controller/WebSocketListener.hpp index 1ecfba6..c8480fb 100644 --- a/server/src/controller/WebSocketListener.hpp +++ b/server/src/controller/WebSocketListener.hpp @@ -49,7 +49,7 @@ class WebSocketListener : public oatpp::websocket::AsyncWebSocket::Listener { /** * Called on "close" frame */ - CoroutineStarter onClose(const std::shared_ptr& socket, v_word16 code, const oatpp::String& message) override { + CoroutineStarter onClose(const std::shared_ptr& socket, v_uint16 code, const oatpp::String& message) override { ++ FRAMES; return nullptr; // do nothing } @@ -57,7 +57,7 @@ class WebSocketListener : public oatpp::websocket::AsyncWebSocket::Listener { /** * Called on each message frame. After the last message will be called once-again with size == 0 to designate end of the message. */ - CoroutineStarter readMessage(const std::shared_ptr& socket, v_word8 opcode, p_char8 data, oatpp::v_io_size size) override { + CoroutineStarter readMessage(const std::shared_ptr& socket, v_uint8 opcode, p_char8 data, oatpp::v_io_size size) override { if(size == 0) { // message transfer finished diff --git a/server/test/WebSocketTest.cpp b/server/test/WebSocketTest.cpp index 13e90ce..68a2666 100644 --- a/server/test/WebSocketTest.cpp +++ b/server/test/WebSocketTest.cpp @@ -107,11 +107,11 @@ class ClientSocketListener : public oatpp::websocket::AsyncWebSocket::Listener{ return nullptr; } - CoroutineStarter onClose(const std::shared_ptr& socket, v_word16 code, const oatpp::String& message) override { + CoroutineStarter onClose(const std::shared_ptr& socket, v_uint16 code, const oatpp::String& message) override { return nullptr; } - CoroutineStarter readMessage(const std::shared_ptr& socket, v_word8 opcode, p_char8 data, oatpp::v_io_size size) override { + CoroutineStarter readMessage(const std::shared_ptr& socket, v_uint8 opcode, p_char8 data, oatpp::v_io_size size) override { if(size == 0) { auto wholeMessage = m_messageBuffer.toString(); m_messageBuffer.clear();