Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is boost::asio equivalent to Poco::Net?

I am part of a project that is using boost as a c++ library. Now we want to use SMTP/POP3/SSL/HTTP/HTTPS. I detected several fitting classes and functions in Poco::Net

  • Poco::Net::POP3ClientSession
  • Poco::Net::MailMessage
  • Poco::Net::SMTPClientSession
  • Poco::Net::HTTPSClientSession
  • Poco::Net::HTTPRequest

I could not find anything equivalent in boost::asio. Before I make my final decision, I want to ask the community, if I am right, or if there is something similar in boost...

like image 998
heinob Avatar asked Dec 03 '22 23:12

heinob


1 Answers

Although there is some overlap, Boost.Asio is not the equivalent of POCO's Net library. Higher-level protocols are outside of the scope for Boost.Asio. The rationale of the library explicitly states that it is a tookit, rather than a framework, that has been designed to support the development of other libraries that provide higher levels of abstraction, such as HTTP. Furthermore, I am not aware of any Boost libraries (released or candidates) that provide support for higher-level protocols. One alternative may be the cpp-netlib library, which is still in development, and aims to provide support for higher-level protocols. However, it currently only has an HTTP client and server implemented.

If you are looking for higher-level protocol support, then POCO is could be a good candidate. However, before making a decision, I would suggest considering other points:

  • Support: On StackOverflow boost-asio appears to be more active than poco-libraries. Other avenues for support include the Boost Mailing List and the POCO fourms.
  • Boost.Asio is designed to be a toolkit and leverages generic programming. While POCO provides some functionality through non-framework means, some of the higher-level functionality is only provided through frameworks. As such, it introduces a tighter coupling with the application, and may affect an application's design.
  • Asynchronous programming between the two libraries is slightly different. In POCO, callbacks are associated to an event type, allowing a callback to be executed multiple times for a single subscription. On the other hand, Boost.Asio associates a callback to a single operation, resulting in a callback being called at most once for a given operation. This difference can have consequences in how the asynchronous chains are designed and flow.
like image 124
Tanner Sansbury Avatar answered Jan 29 '23 08:01

Tanner Sansbury