Questions tagged [asio]

ASIO stands for Audio Stream Input/Output, a digital audio protocol. For questions about the Boost.Asio C++ library for asynchronous I/O, use the [boost-asio] tag to avoid ambiguity.

Audio Stream Input/Output is a low-latency protocol for sending and receiving audio data from sound interfaces. It was developed by Steinberg, which offers a licensed ASIO SDK among other audio software technology such as VST plugins.


Please note that in order to avoid ambiguity, questions about Boost.Asio should be tagged with as discussed on meta.

479 questions
3
votes
2 answers

Double free or corruption when using asio

I made some modifications to this code snippet which is used to send\recieve ICMP packets through ASIO APIs. Here are the modifications that I made(full code snippet is seen below): using the standard version API instead of the corresponding API…
John
  • 2,963
  • 11
  • 33
3
votes
1 answer

boost::asio::bind_executor does not execute in strand

The following example completes with no assertions: #include #include #include #include #include class example1 { public: typedef boost::asio::io_context io_context; typedef…
evoskuil
  • 1,011
  • 1
  • 7
  • 13
3
votes
1 answer

How can I effectively use boost::process::async_pipe for both writing and reading?

I've already seen the boost::process tutorial... but there the example is a single write then a single read from the child process. I want to know if it is possible to have both async_pipes alive (read and write) during the child process…
R. Pires
  • 51
  • 5
3
votes
1 answer

What is the implement of asio::this_coro::executor

In a coroutine function, we can add auto ex = co_await asio::this_coro::executor; to get the executor of this coroutine. But when I want to learn the definition of it, I found this: /// Awaitable type that returns the executor of the current…
3
votes
2 answers

Boost ASIO segfault in release mode

I have made this small illustrative code that exhibits the same issues the program I'm writing does: namely, it works fine in debug mode, segfaults in release. The problem seems to be that the ui_context, in release mode, when being called to run…
serje
  • 33
  • 4
3
votes
1 answer

How would I include asio library using CMake?

I am trying to work on a project for a class and I want to use CMake to build the project. My current project looks like |-bin |-CMakeLists.txt |-include |-asio-1.12.2 |-chat_message.hpp |-chat_message.cpp |-CMakeLists.txt |-src …
Ruben-96
  • 67
  • 1
  • 6
3
votes
3 answers

Boost ASIO strand: wait for pending tasks to complete

Is it possible to know when all pending asynchronous tasks in strand are complete? Just like thread.join() does in the following example: io_service service; std::thread thread([&](){ service.run();…
san
  • 443
  • 5
  • 12
3
votes
1 answer

boost beast websocket server read with error code End of file and Operation cancelled

I am trying to setup a websocket server as described in this boost beast example. Everything works fine except that the websocket stream read throw unexpeced system error with error code of "End of file" and "Operation cancelled" beast::flat_buffer…
FaceBro
  • 787
  • 2
  • 13
  • 29
3
votes
2 answers

boost::asio allow non-blocking accept of new connections while handler for connection is blocking

Very short summarized: I am implementing a simple TCP server using boost::asio that allows for non-blocking acception of new connnections. Inside the logic of handling the new connection a lot of work will be performed that might take up to several…
Paxi1337
  • 85
  • 8
3
votes
1 answer

Async sending and receiving custom data packets with boost?

I am trying to asynchronously send and receive custom data packets with boost and I have some questions, based on my current implementation: tcpclient.cpp #include "tcpclient.h" #include #include…
Kyu96
  • 1,159
  • 2
  • 17
  • 35
3
votes
1 answer

Building Boost ASIO without threading

I want to build all the boost asio http server examples from: https://github.com/boostorg/asio/tree/develop/example/cpp03/http But catch is, I need to use c++03/98, single threaded without dependencies on std::thread, boost::thread or posix threads.…
ericcurtin
  • 1,499
  • 17
  • 20
3
votes
1 answer

boost asio concurrent async_read and async_write

Looking at the documentation it looks like the TCP socket object is not thread-safe. So I cannot issue async_read from one thread and async_write concurrently from another thread? Also I would guess it applies to boost::asio::write() as well? Can I…
MGH
  • 475
  • 7
  • 19
3
votes
0 answers

Why is noexcept not used in async libraries (like Asio and Beast)

Asynchronous functions often do not use exceptions. Even on synchronous calls, Asio and Boost-Beast have overloads that take an output argument of type system_error& instead of throwing. Asynchronous operations can't throw exceptions because the…
Benjamin Buch
  • 4,752
  • 7
  • 28
  • 51
3
votes
1 answer

boost asio post request with large body

I am trying to use boost::asio to make a synchronous http POST request to localhost:55001/predict with a large body (around 8784000 characters). I am able to do this just fine in python using the requests package. My server is able to handle the…
Aakash282
  • 31
  • 3
3
votes
1 answer

Boost asio: unable to acknowledge a file transfer

I am using boost asio to perform file transfers over TCP. The file transfer works, however when I decide to implement a simple acknowledge message from server to client by chaining async_write (on server) and async_read_until (on client), I observe…
drulex
  • 47
  • 4
1 2
3
31 32