Skip to content

Commit 580af7a

Browse files
committed
update to the latest oatpp API version.
1 parent f010114 commit 580af7a

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
jobs:
2-
- job: ubuntu_16_04
3-
displayName: 'Build - Ubuntu 16.04'
2+
- job: ubuntu_20_04
3+
displayName: 'Build - Ubuntu 20.04'
44
continueOnError: false
55
pool:
6-
vmImage: 'Ubuntu 16.04'
6+
vmImage: 'ubuntu-20.04'
77
container:
88
image: lganzzzo/ubuntu-cmake:latest
99
workspace:

client/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ add_library(${project_name}-lib
1818

1919
## link libs
2020

21-
find_package(oatpp 1.2.5 REQUIRED)
22-
find_package(oatpp-websocket 1.2.5 REQUIRED)
21+
find_package(oatpp 1.3.0 REQUIRED)
22+
find_package(oatpp-websocket 1.3.0 REQUIRED)
2323

2424
target_link_libraries(${project_name}-lib
2525
PUBLIC oatpp::oatpp

client/src/ClientSocketListener.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class ClientCoroutine : public oatpp::async::Coroutine<ClientCoroutine> {
150150
}
151151

152152

153-
Action onConnected(const std::shared_ptr<oatpp::data::stream::IOStream>& connection) {
153+
Action onConnected(const oatpp::provider::ResourceHandle<oatpp::data::stream::IOStream>& connection) {
154154
++ SOCKETS;
155155
m_socket = oatpp::websocket::AsyncWebSocket::createShared(connection, true /* maskOutgoingMessages for clients always true */);
156156

server/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ add_library(${project_name}-lib
1919

2020
## link libs
2121

22-
find_package(oatpp 1.2.5 REQUIRED)
23-
find_package(oatpp-websocket 1.2.5 REQUIRED)
22+
find_package(oatpp 1.3.0 REQUIRED)
23+
find_package(oatpp-websocket 1.3.0 REQUIRED)
2424

2525
target_link_libraries(${project_name}-lib
2626
PUBLIC oatpp::oatpp

server/src/App.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,11 @@ void run(const oatpp::base::CommandLineArguments& args) {
5252
AppComponent components(args); // Create scope Environment components
5353

5454
/* create ApiControllers and add endpoints to router */
55-
5655
auto router = components.httpRouter.getObject();
57-
58-
auto myController = MyController::createShared();
59-
myController->addEndpointsToRouter(router);
56+
57+
router->addController(MyController::createShared());
6058

6159
/* create servers */
62-
6360
OATPP_COMPONENT(std::shared_ptr<std::list<std::shared_ptr<oatpp::network::ServerConnectionProvider>>>, connectionProviders);
6461

6562
std::list<std::thread> threads;

server/test/WebSocketTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class ClientCoroutine : public oatpp::async::Coroutine<ClientCoroutine> {
151151
return connector->connectAsync("ws").callbackTo(&ClientCoroutine::onConnected);
152152
}
153153

154-
Action onConnected(const std::shared_ptr<oatpp::data::stream::IOStream>& connection) {
154+
Action onConnected(const oatpp::provider::ResourceHandle<oatpp::data::stream::IOStream>& connection) {
155155
socket = oatpp::websocket::AsyncWebSocket::createShared(connection, true);
156156
socket->setListener(std::make_shared<ClientSocketListener>());
157157
executor->execute<ClientSenderCoroutine>(socket);

0 commit comments

Comments
 (0)