I am implementing a client application that needs to make a small number of socket connections to hardware devices. I broke the problem into the following small subset of code
boost::system::error_code ec;
std::string str_message = ec.message();
std::string str_port = "502";
std::string str_ip = "192.168.12.198";
boost::asio::io_service io_service;
boost::asio::ip::tcp::resolver resolver(io_service);
boost::asio::ip::tcp::resolver::query query(boost::asio::ip::tcp::v4(),str_ip,str_port);
boost::asio::ip::tcp::resolver::iterator iterator = resolver.resolve(query);
boost::asio::ip::tcp::socket s(io_service);
ec = s.connect(*iterator,ec);
if (ec)
{
std::string str_debug = ec.message();
}
Embarcadero RAD studio XE4 ++ Builder, VCL, . , , TThread, . , error_code connect, m_cat error_code NULL, , message(), . , .
, , ? , , .
, , 1,50, , 64- RAD.
- ( Embarcadero ), , ? ?