Skip to content

Commit

Permalink
Update to the latest oatpp API version
Browse files Browse the repository at this point in the history
  • Loading branch information
lganzzzo committed Jan 25, 2020
1 parent 1354af4 commit 55a92c2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions client/src/ClientSocketListener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ class ClientSocketListener : public oatpp::websocket::AsyncWebSocket::Listener{
/**
* Called on "close" frame
*/
CoroutineStarter onClose(const std::shared_ptr<AsyncWebSocket>& socket, v_word16 code, const oatpp::String& message) override {
CoroutineStarter onClose(const std::shared_ptr<AsyncWebSocket>& socket, v_uint16 code, const oatpp::String& message) override {
++ FRAMES;
return nullptr; // do nothing
}

/**
* 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<AsyncWebSocket>& socket, v_word8 opcode, p_char8 data, oatpp::v_io_size size) override {
CoroutineStarter readMessage(const std::shared_ptr<AsyncWebSocket>& socket, v_uint8 opcode, p_char8 data, oatpp::v_io_size size) override {

if(size == 0) { // message transfer finished

Expand Down
4 changes: 2 additions & 2 deletions server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions server/src/controller/WebSocketListener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ class WebSocketListener : public oatpp::websocket::AsyncWebSocket::Listener {
/**
* Called on "close" frame
*/
CoroutineStarter onClose(const std::shared_ptr<AsyncWebSocket>& socket, v_word16 code, const oatpp::String& message) override {
CoroutineStarter onClose(const std::shared_ptr<AsyncWebSocket>& socket, v_uint16 code, const oatpp::String& message) override {
++ FRAMES;
return nullptr; // do nothing
}

/**
* 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<AsyncWebSocket>& socket, v_word8 opcode, p_char8 data, oatpp::v_io_size size) override {
CoroutineStarter readMessage(const std::shared_ptr<AsyncWebSocket>& socket, v_uint8 opcode, p_char8 data, oatpp::v_io_size size) override {

if(size == 0) { // message transfer finished

Expand Down
4 changes: 2 additions & 2 deletions server/test/WebSocketTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ class ClientSocketListener : public oatpp::websocket::AsyncWebSocket::Listener{
return nullptr;
}

CoroutineStarter onClose(const std::shared_ptr<AsyncWebSocket>& socket, v_word16 code, const oatpp::String& message) override {
CoroutineStarter onClose(const std::shared_ptr<AsyncWebSocket>& socket, v_uint16 code, const oatpp::String& message) override {
return nullptr;
}

CoroutineStarter readMessage(const std::shared_ptr<AsyncWebSocket>& socket, v_word8 opcode, p_char8 data, oatpp::v_io_size size) override {
CoroutineStarter readMessage(const std::shared_ptr<AsyncWebSocket>& socket, v_uint8 opcode, p_char8 data, oatpp::v_io_size size) override {
if(size == 0) {
auto wholeMessage = m_messageBuffer.toString();
m_messageBuffer.clear();
Expand Down

0 comments on commit 55a92c2

Please sign in to comment.