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
1
vote
2 answers

Undefined reference to

I am trying to use ASIO (Audio Stream Input/Output). I downloaded SDK, but because this SDK has no library, only headers and source files, I had to compile it into a library. Moreover, it was written so that it uses some of the features from MSVC…
Jakub Zaverka
  • 8,816
  • 3
  • 32
  • 48
1
vote
1 answer

440 Boost ASIO websocket connections take up 220k file descriptors

I had posted this earlier but hadn't posted a proper minimum working example, apologies for that. The problem is quite clear. Starting 440 websocket connections with Boost ASIO eats up about 220,000 file descriptors. Here's how I come to that…
Max
  • 13
  • 4
1
vote
1 answer

Asio. Error: "The I/o operation has been aborted because of either a thread exit or an application requests"

I am trying to create an async server using asio but when the acceptor calls async_accept function, I get this error The I/o operation has been aborted because of either a thread exit or an application requests, which doesn't let the process…
1
vote
1 answer

Is calling co_spawn on the same io_context instance from different threads safe, and does it guarantee execution on the same thread?

I am working on a project that leverages boost::asio::io_context across different threads, and specifically, I want to use co_spawn to initiate coroutines. Here's a simplified code snippet: #include #include…
userbb
  • 2,148
  • 5
  • 30
  • 53
1
vote
1 answer

boost asio socket with only ONE accepted message

I'm new in coding boost asio and asynchronous TCP socket data transfer. I've been stopped in sending multiple messages from client to server because my server accepts only one message. I tried to follow solution here to call another async_read_some…
1
vote
0 answers

boost asio io_context run hangs in a thread

I have a server application that hangs randomly after a few hours of running. I have a pool of I/O threads to handle accept, read & write asynchronously. At random points, no connections are accepted, nor any data is read. I suspected that…
user5266221
  • 33
  • 1
  • 6
1
vote
0 answers

boost::asio - async_read_some and boost::asio::socket_base::bytes_readable

I have a problem with the function async_read_some(). I am running cyclicly the function receiveAsyncWithTimeout() by a timer. Expected working The function receiveAsyncWithTimeout() should read all messages from my…
Michał Hanusek
  • 199
  • 3
  • 13
1
vote
1 answer

Boost.Beast `tcp_stream`'s `async_connect` waits full duration with `use_future`

I'm writing a connection manager class that should establish connection to the server and send several HTTP requests using Boost.Beast. It has a connect method that should return true if connection was successful and false otherwise. I am using…
1
vote
1 answer

How to handle coroutines in deleted classes?

I have a class that contains a coroutine method. If the coroutine is executed and waits in a halted state the object may be deleted. At some point the coroutine will resume while it's class got deleted. In traditional async code i made methods with…
Spide
  • 89
  • 5
1
vote
1 answer

Boost.Asio stackless coroutine with different CompletionToken signatures

Question Boost.Asio's asynchronous functions have various CompletionToken signature. For example, boost::asio::async_write has WriteToken. void write_handler( const boost::system::error_code& ec, std::size_t…
Takatoshi Kondo
  • 3,111
  • 17
  • 36
1
vote
1 answer

Websocket client not closing gracefully

I followed this link to create a websocket client. This is the class for that: #include #include #include #include class WebsocketClient…
ATK
  • 1,296
  • 10
  • 26
1
vote
0 answers

Custom protocol over TCP with asio, issues with implementation

A custom tcp client-server implementation with asio, problem with reading the data the client already exchanged to the server side, async_read simply closes on itself, i've managed to pass both the header and the body, but server is stuck on reading…
1
vote
1 answer

asio::steady_timer does NOT work with completion handler "use_awaitable"

I am being confused the asio::timer coroutine with completion handler "use_awaitable" does not work if I modify the timer in another coroutine. The "Leave foo" never reached: Enter foo Enter bar Leave bar The End Below is code: static…
wk1999
  • 13
  • 3
1
vote
2 answers

Using asio::io_context::strand to serialize posted tasks

I'm trying to synchronized the completion handlers using strand but I'm not getting the expected out. When I'm using asio::post without wrapping the completion handler in strand I get the correct output but it is not synchronized. When I wrap the…
Aamir
  • 1,974
  • 1
  • 14
  • 18
1
vote
1 answer

How to choose a specific audio output device in Firefox or Chrome?

I'm building a low-latency sampler in the browser (using Javascript, WASM, etc.). How to choose, from Javascript, a specific audio output device for Chrome or Firefox? I see there is Audio Output API but there are not many examples (and by the way…
Basj
  • 41,386
  • 99
  • 383
  • 673