55
66#include " oatpp/web/server/AsyncHttpConnectionHandler.hpp"
77#include " oatpp/web/server/HttpRouter.hpp"
8- #include " oatpp/network/server/SimpleTCPConnectionProvider .hpp"
8+ #include " oatpp/network/tcp/ server/ConnectionProvider .hpp"
99
1010#include " oatpp/parser/json/mapping/ObjectMapper.hpp"
1111
@@ -33,7 +33,7 @@ class AppComponent {
3333 * Create ConnectionProvider component which listens on the port
3434 */
3535 OATPP_CREATE_COMPONENT (std::shared_ptr<oatpp::network::ServerConnectionProvider>, serverConnectionProvider)([] {
36- return oatpp::network::server::SimpleTCPConnectionProvider ::createShared (8000 );
36+ return oatpp::network::tcp:: server::ConnectionProvider ::createShared ({ " localhost " , 8000 } );
3737 }());
3838
3939 /* *
@@ -46,7 +46,7 @@ class AppComponent {
4646 /* *
4747 * Create ConnectionHandler component which uses Router component to route requests
4848 */
49- OATPP_CREATE_COMPONENT (std::shared_ptr<oatpp::network::server:: ConnectionHandler>, serverConnectionHandler)(" http" , [] {
49+ OATPP_CREATE_COMPONENT (std::shared_ptr<oatpp::network::ConnectionHandler>, serverConnectionHandler)(" http" , [] {
5050 OATPP_COMPONENT (std::shared_ptr<oatpp::web::server::HttpRouter>, router); // get Router component
5151 OATPP_COMPONENT (std::shared_ptr<oatpp::async::Executor>, executor); // get Async executor component
5252 return oatpp::web::server::AsyncHttpConnectionHandler::createShared (router, executor);
@@ -62,7 +62,7 @@ class AppComponent {
6262 /* *
6363 * Create websocket connection handler
6464 */
65- OATPP_CREATE_COMPONENT (std::shared_ptr<oatpp::network::server:: ConnectionHandler>, websocketConnectionHandler)(" websocket" , [] {
65+ OATPP_CREATE_COMPONENT (std::shared_ptr<oatpp::network::ConnectionHandler>, websocketConnectionHandler)(" websocket" , [] {
6666 OATPP_COMPONENT (std::shared_ptr<oatpp::async::Executor>, executor);
6767 auto connectionHandler = oatpp::websocket::AsyncConnectionHandler::createShared (executor);
6868 connectionHandler->setSocketInstanceListener (std::make_shared<WSInstanceListener>());
0 commit comments