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
1 answer

How do I do IP address manipulation (masking, or'ing, etc) with boost asio?

I have an application that is meant to be installed into multiple environments, each with the same relative IP addresses. By way of example, let's say there are three devices (it's much more complicated than this but I've pared it down for…
paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
3
votes
2 answers

"String iterator not dereferncable" with boost async_read_some

I have a server that uses asynchronous sockets from boost with an "accept" function as follows ("User" is pretty much equivalent of "Session" in this example): accept() { this->_acceptor.async_accept(this->_socket,…
3
votes
1 answer

How to avoid firing already destroyed boost::asio::deadline_timer

I'm using multiple boost::asio::deadline_timer on one io_service object. std::shared_ptr of boost::asio::deadline_timer are stored in the container std::map> timers with index. In the timer handler, I erase other…
Takatoshi Kondo
  • 3,111
  • 17
  • 36
3
votes
1 answer

How to call boost async_connect as member function using lamba as connect handler

I implemented async_connect successfully using it as a free function and a lambda as connect_handler as follows: auto self(shared_from_this()); boost::asio::async_connect(m_socket, endpoint_iter, [this, self](boost::system::error_code ec,…
GregPhil
  • 475
  • 1
  • 8
  • 20
3
votes
3 answers

Is it possible to capture audio from an ASIO device with ffmpeg?

We have a setup with a Windows 7 machine where we installed Dante Virtual Soundcard and start that soundcard with ASIO capabilities. The soundcard will receive audio over the network from a Tesira server. We want to capture the audio to files…
Amfasis
  • 3,932
  • 2
  • 18
  • 27
3
votes
2 answers

How to parse interleaved buffer into distinct multiple channel buffers with PortAudio

hope you can help me :) I'm trying to get audio data from a multichannel ASIO device with PortAudio library. Everything is ok: I managed to set the default host API as ASIO and I also managed to select 4 specific channels as inputs. Then,I get an…
ignatius
  • 189
  • 2
  • 14
3
votes
2 answers

Asio async and concurrency

I'm writing some code with boost::asio, using asynchronous TCP connections. I've to admit that I have some doubts about it. All these regarding concurrency. Here are some: What happens if I start two or more async_write on the same socket without…
gotch4
  • 13,093
  • 29
  • 107
  • 170
3
votes
2 answers

Writing binary mangles data

In my application, I record audio data from an ASIO driver: void newData(void *buffer, int length) where buffer is the buffer pointer and length is the number of samples in that buffer. In my case, I know that the samples are 4-byte integers and…
Jakub Zaverka
  • 8,816
  • 3
  • 32
  • 48
2
votes
1 answer

Asio async_wait gives Operation canceled

The below simple async_wait example gives Operation canceled error. #include #include void waitForTimer(boost::asio::io_context& ioContext) { boost::asio::steady_timer timer(ioContext,…
2
votes
1 answer

Why would ASIO socket open() ever fail?

When connecting to a socket with ASIO, you need to (1) create the socket; (2) open() it; (3) connect() it. boost::asio::io_context io_context; // (1) create socket boost::asio::ip::tcp::socket socket(io_context); // (2) open…
Arthur Tacca
  • 8,833
  • 2
  • 31
  • 49
2
votes
0 answers

How to use gsl::span with asio

The problem: I cannot compile asio to use a buffer with gsl::span Constraints: C++ Version allowed: <= C++17 Boost allowed: No Microsoft GSL 4.0.0, or newer as it's available Asio 1.28.0, or newer as it's available I'm trying to use gsl::span in…
Ryan Friedman
  • 115
  • 1
  • 9
2
votes
1 answer

asio and "streaming server"

I'm using asio library (C++) and I would like to create a pair of server/client such that: The server is streaming data on some port; The client connect to that port and receive such data. Now, in usual client/server applications the server is…
MaPo
  • 613
  • 4
  • 9
2
votes
1 answer

How to set TCP_QUICKACK for Boost ASIO TCP socket

I am trying to set TCP_QUICKACK for my Boost TCP server/client application. I couldn't find the TCP_QUICKACK in Boost asio. How can I set this option?
anlgrses
  • 371
  • 4
  • 12
2
votes
1 answer

Using std::future with asio::async_connect

I am using the asio library and I am trying to connect to a socket. Sometimes, the socket may take a very long time to connect. In that case, i just want to cancel the connection. I am attempting to use std::future and asio::use_future…
ILutRf7
  • 39
  • 2
2
votes
1 answer

How to implement robust, leak-free session object destruction in Boost.ASIO based applications?

I have a WebSocket server done with Boost.ASIO and Boost.Beast. It follows the idiomatic ASIO design: session (connection) objects own the communication socket and derive from std::enable_shared_from_this. Async completion handlers capture a…
Gyorgy Szekely
  • 2,654
  • 3
  • 23
  • 32