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
4
votes
2 answers

Unable to compile sample crowtest.cpp with crow

I'm trying to run a sample c++ program using crow but getting the error fatal error: asio.hpp: No such file or directory Installed crow using the instructions in https://crowcpp.org/master/getting_started/setup/linux/#installing-from-source Followed…
4
votes
1 answer

Confusion about "asio::async_compose"" vs "asio::async_initiate"

I am slowly understanding the asio way of doing things as I migrate legacy callback code to use completion tokens. So far I have been following the pattern described in the callback_wrapper.cpp example which uses asio::asio::async_initiate. Then I…
4
votes
2 answers

Why does ASIO not apply serial port settings when sending data (only receiving)?

I have a program that uses the modbus protocol to send chunks of data between a 64-bit Raspberry Pi 4 (running Raspberry Pi OS 64) and a receiving computer. My intended setup for the serial port is baud rate of 57600, 8 data bits, two stop bits, no…
Matt
  • 330
  • 1
  • 2
  • 11
4
votes
3 answers

boost asio and co_await to interrupt the coroutine

I am trying out the C++20 coroutines with boost asio. My current intention is to embed in the coroutine example from https://www.boost.org/doc/libs/1_75_0/doc/html/boost_asio/example/cpp17/coroutines_ts/echo_server.cpp a simple suspension point. As…
divot53305
  • 61
  • 3
4
votes
1 answer

ASIO proper handling of multiple threads + strand + socket + timer

I'm using the latest ASIO version(as of this time 1.18.0). Currently designing a multithreaded asynchronous TCP server with timers(for timeouts). I have a single io_context with multiple threads calling its run() function. I accept new connections…
The Storm
  • 71
  • 8
4
votes
1 answer

Boost process continuously read output

I'm trying to read outputs/logs from different processes and display them in a GUI. The processes will be running for long time and produce huge output. I'm planning to stream the output from those processes and display them according to my needs.…
Surya
  • 1,139
  • 1
  • 11
  • 30
4
votes
1 answer

C++ Boost ASIO: initializing io_context inside class:

I am following Boost UDP multicast sender tutorial here . I modify it to make a class as follow: #define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include…
CaTx
  • 1,421
  • 4
  • 21
  • 42
4
votes
0 answers

different behaviour of ICMP in IPv4 and IPv6

I'm using boost asio icmp sockets to send and receive ICMP packets. My code is based on the boost example: http://www.boost.org/doc/libs/1_51_0/doc/html/boost_asio/example/icmp/ping.cpp I tried to do the same in IPv6. I can send ICMP messages…
Christi258
  • 51
  • 2
4
votes
1 answer

How to set error_code to asio::yield_context

I'd like to create an asynchronous function which takes as it's last argument boost::asio::yield_context. E.g.: int async_meaning_of_life(asio::yield_context yield); I'd also like to be consistent with how Asio returns error codes. That is, if the…
Peter Jankuliak
  • 3,464
  • 1
  • 29
  • 40
4
votes
1 answer

Boost::ASIO VS Qt networking

I want to make some networking application. I wanted to use Qt, but it's networking library is relatively big and then I tried to learn Boost::asio, but it seems to have the same amount of size What is a library that has small footprint? As small as…
w4j3d
  • 341
  • 2
  • 6
  • 12
4
votes
4 answers

Boost::ASIO: How can I capture return value from io_service?

How can I capture return values from boost::asio::io_service? Is it possible to use some bind or any simple construct for that that doesn't involve rewriting functions? The following is a minimal example. The I'm trying to capture the value return…
The Quantum Physicist
  • 24,987
  • 19
  • 103
  • 189
4
votes
2 answers

What does this error error:140000DB:SSL routines:SSL routines:short read means

In our software, we are keep getting this warning/error message intermittently. Not sure how/why this message appears. HTTP asio handshake failed: error:140000DB:SSL routines:SSL routines:short read I searched in the Internet, but the mostly the…
doliharahap
  • 100
  • 2
  • 6
3
votes
2 answers

Binding an allocator to a custom token

I would like to know how I can bind an allocator to a custom token of mine and use it in the token's async_result implementation? If we take use_tuple as an example, it seems to only work with its own use_tuple.rebind(another_allocator) allocator,…
Johannes Schaub - litb
  • 496,577
  • 130
  • 894
  • 1,212
3
votes
1 answer

Sending async https request using boost/beast

I had a synchronous method that send https request using http::write and than expect to read it's response using http::read. However, in order to add timeout I had to move to async calls in my method. So I've tried to use http::async_read and…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
3
votes
1 answer

Can I co_await an operation executed by one io_context in a coroutine executed by another in Asio?

I have an HTTP server library writen by Asio with one io_context per thread model. It has an io_context_pool which retrieves one io_context orderly. So when the server starts, io_context #1 will be used to execute the acceptor and io_context #2 will…
Kidsunbo
  • 1,024
  • 1
  • 11
  • 21
1
2
3
31 32