This commit is contained in:
Антон 2024-03-24 22:28:28 +03:00
parent a2d1d11167
commit 33208be2b8
3 changed files with 32 additions and 15 deletions

View File

@ -21,7 +21,7 @@ find_package(Threads REQUIRED)
configure_file(config.json ${CMAKE_BUILD_RPATH} config.json COPYONLY)
add_executable(hello_async
main.cpp
add_executable(endpoint.cpp
endpoint.cpp
src/sdk.h)
target_link_libraries(hello_async PRIVATE Threads::Threads)
target_link_libraries(endpoint.cpp PRIVATE Threads::Threads)

View File

@ -0,0 +1,29 @@
#include "src/sdk.h"
//
#include <boost/asio.hpp>
#include <iostream>
using namespace boost;
namespace sys = boost::system;
using namespace std;
int main()
{
string raw_ip_address = "127.0.0.1"s;
uint32_t port_num = 3333;
sys::error_code ec;
asio::ip::address ip_address = asio::ip::address::from_string(raw_ip_address, ec);
if (ec.value())
{
cout << "Failed to parse the IP address. Error code = " << ec.value() << ". Message: "
<< ec.message();
return ec.value();
}
asio::ip::tcp::endpoint endpoint(ip_address, port_num);
return EXIT_SUCCESS;
}

View File

@ -1,12 +0,0 @@
#include "src/sdk.h"
//
#include <boost/asio/signal_set.hpp>
#include <iostream>
#include <mutex>
#include <thread>
#include <vector>
int main()
{
return EXIT_SUCCESS;
}