Questions tagged [boost-asio]

Boost.Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach.

Most programs interact with the outside world in some way, whether it be via a file, a network, a serial cable, or the console. Sometimes, as is the case with networking, individual I/O operations can take a long time to complete. This poses particular challenges to application development. The Boost.Asio library is intended for programmers using C++ for systems programming, where access to operating system functionality such as networking is often required.

More information on Boost.Asio can be found here:

Notable alternatives for Boost.Asio:

4582 questions
2
votes
4 answers

memcpy that doesn't really make sense to me

I have some socket connection code that makes use of boost::asio which reads from a socket the first 5 chars, from which it can determine if the sent string was compressed using zlib library. The project I'm currently doing is a rewrite of…
Tony The Lion
  • 61,704
  • 67
  • 242
  • 415
2
votes
2 answers

How do I avoid body_limit error in boost's beast and correctly handle large messages

I have cases when there is a chunked response which is too big for beast, and I want to stop before I get to beast's body_limit, and continue handling the message from that point using plain boost::asio. Mind that this (obviously) means I already…
david-hoze
  • 1,045
  • 15
  • 31
2
votes
1 answer

Compiler error when including boost/asio.hpp on C++ Builder 2010

EDIT: SOLVED! I added BOOST_ALL_NO_LIB to my Conditional defines and added the errorcode.cpp from /libs/system/src/ folder to my Project. I recently set up C++ Builder and been playing around with it to get my head around C++. I need to use…
Codemonkey
  • 3,412
  • 3
  • 20
  • 24
2
votes
1 answer

constructor leads to "use of deleted function" error

I'm trying to initialize a variable internal to my structure by calling a custom constructor This is for a https project that uses boost asio to communicate with a server. Basically I want to initialize an IO context with an struct with parameters.…
Farynx
  • 93
  • 1
  • 7
2
votes
1 answer

Boost socket async_send: how does it handle ewouldblock?

On Unix, send() on a non-blocking socket could return error EWOULDBLOCK if outbound socket buffer is full. In this case, one should call select() to determine when it's possible to retry. Does Boost sockets in nonblocking mode handle all of this for…
theactiveactor
  • 7,314
  • 15
  • 52
  • 60
2
votes
1 answer

Boost ASIO TCP server architecture

Im new to either boost and asio (but not to network programming) and Im currently trying to create a TCP server accepting multiple clients. The primary functionnality of the server with clients is simple : 1- Read a Header with a fixed size; 2-…
Axel.A
  • 94
  • 1
  • 9
2
votes
1 answer

Use of Boost.Coroutine with Boost.ASIO causes assertion

I have boost::asio::io_context which is running in several threads (via ctx.run()) and I have several asynchronous objects that are used inside boost.coroutines, which are running via boost::asio::spawn. And I have the following assertion: Assertion…
kromberged
  • 31
  • 6
2
votes
1 answer

boost asio open socket without using deprecated methods

Modern boost asio has deprecated the code used in every example I can find. The examples suggest code like this: const char * host = "www.google.com"; const char * port = "http"; boost::asio::io_service io_service; tcp::resolver…
Joseph Larson
  • 8,530
  • 1
  • 19
  • 36
2
votes
1 answer

Is boost_asio_handler_invoke_helpers::invoke still a supported way to invoke completion handler in boost asio 1.70?

I am migrating a code using asio from boost 1.65.1 to 1.70.0. There is a code that use boost_asio_handler_invoke_helpers::invoke and it seem not working as in previous version. I found this issue https://github.com/boostorg/asio/issues/79 on…
ichorate
  • 33
  • 5
2
votes
1 answer

Where is boost::asio::windows::stream_handle in boost 1.46.1?

Once uppon a time we had boost code like: typedef BoostAsioPipe pipe; #elif defined(BOOST_POSIX_API) typedef boost::asio::posix::stream_descriptor pipe; #elif defined(BOOST_WINDOWS_API) typedef boost::asio::windows::stream_handle pipe; #else # …
Rella
  • 65,003
  • 109
  • 363
  • 636
2
votes
2 answers

Compiling programme with boost.asio library

I have installed all boost libraries, but when compiling g++ sda.cpp -lboost_system -lboost_date_time -lboost_regex -lboost_thread -lboost_serialization #include int main() { return 0; } i obtain several errors, and…
dfk
  • 101
  • 2
  • 3
2
votes
1 answer

Searching in a Boost Asio Buffer

I have a boost buffer and I'm going to search something inside this buffer, something like this code: auto buffer = boost::asio::buffer(my_array, my_array_size); if (buffer.find("Hello")) cout << "Found"; else cout << "Not Found"; I know that…
s4eed
  • 7,173
  • 9
  • 67
  • 104
2
votes
1 answer

Integrate boost-asio with file descriptor based socket api from KDB+

I'm relatively new to boost-asio and I'm wondering if it's possible to make it work with KDB+ api here. I tried something like the below but it doesn't seem to work properly, #include #include #include #include…
Danny
  • 391
  • 2
  • 12
2
votes
1 answer

ASIO ip::tcp::iostream and TCP_NODELAY

How do i set TCP_NODELAY option if i use ip::tcp::iostream? I need a socket for this, but i can't find how to extract it from iostream.
Michael
  • 197
  • 1
  • 2
  • 10
2
votes
1 answer

Error on compiling 'set_ssl_context_callback': on Windows

I want to add some TLS specifications to my context , hence I am using the set_ssl_context_callback. But I get the error "set_ssl_context_callback is not a member of web::http::client::http_client_config" since it is surrounded by : #if…
ritu
  • 75
  • 1
  • 10