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
0 answers

Find selected audiodevice samplerate in Python and PyAudio

When I have an audiodevice like a focusrite scarlett or a behringer UCG 102 connected to my computer, I can use a control panel to change parameters like the samplerate and the size of the audiobuffer. You can see an example of such a control panel…
1
vote
1 answer

asio::ip::tcp::socket auto reconnect by io_service

Under Ubuntu 2404LTS with boost version 1.65.1. I use io_service to initiate asio::ip::tcp::socket async_connect and get socket1, then I read several messages from it. After receving some specific message from socket1, I call io_service::stop() with…
FaceBro
  • 787
  • 2
  • 13
  • 29
1
vote
0 answers

asio::io_context run in thread, asio::steady_timer::async_wait doesn't work

I have tried to create a server with asio, when i try to integrate a timer behind the event handler from client. asio::io_context m_asioContext; std::thread m_threadContext; void print() { std::cout <<…
TPL
  • 9
  • 2
1
vote
1 answer

Boost ASIO "Bad address" error when passing unique_ptr to completion handler

I'm trying to implement a simple TCP server using ASIO. The main difference here is that I'm using std::unique_ptr to hold the buffers instead of raw pointers and I'm moving them inside the completion handler in order to extend their lifetime. Here…
Adriel Santos
  • 653
  • 7
  • 15
1
vote
1 answer

boost.beast : HTTP/1.1 400 Bad Request

#include #include #include #include #include #include #include #include #include…
dopller
  • 291
  • 3
  • 13
1
vote
1 answer

How to create a response from a file that has CJK filename

I'm trying to load a file to be a HTTP response with Boost.Beast, but it doesn't work on Windows. My code is similar to this: typedef boost::beast::http::response response_t; response_t render_response_from_file(const…
Cody
  • 609
  • 4
  • 21
1
vote
1 answer

steady timer asio boost

Why doesn't my timer expire after 1 second but waits for 10 seconds? #include #include #include int main() { boost::asio::io_service io; int count = 0; boost::asio::steady_timer t(io,…
Ioan Irggq
  • 21
  • 1
  • 3
1
vote
1 answer

Asio async_read_until EOF Error in Asynchronous TCP Server

when I build it, and running server and then run client, that appear a error error code = 2, error message = End of file when I code synchronous tcp server it's work ok; thanks full client code #include // Tools to identify the…
Loyio
  • 57
  • 6
1
vote
1 answer

Using Boost Beast to build Platform specific client-side authentication in SSL connection

I’m working on boost::beast based application on macOS platform, and I wonder how I can provide a client-side certificate to authenticate against the server ? basically , in macOS the certificates are stored in keychain, and cannot be exported…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
1
vote
1 answer

How to determine when a socket receives EOF? (C++20 boost asio coroutines)

Consider a simple echo server: #include #include #include #include using boost::asio::awaitable; using boost::asio::buffer; using boost::asio::co_spawn; using…
aleck099
  • 428
  • 2
  • 10
1
vote
1 answer

Boost asio UDP client not receiving data

I'm trying to send data from the server to a specific client using UDP, without making the client send data to the server first, without sending the server data at all. The problem is that the client waits for data using the receive_from() function,…
sourcerful
  • 35
  • 5
1
vote
2 answers

How to ensure that the messages will be enqueued in chronological order on multithreaded Asio io_service?

Following Michael Caisse's cppcon talk I created a connection handler MyUserConnection which has a sendMessage method. sendMessage method adds a message to the queue similarly to the send() in the cppcon talk. My sendMessage method is called from…
Drejc
  • 491
  • 6
  • 21
1
vote
0 answers

Unable to move asio::ssl::stream to handler

Asio v1.20 standalone library server example shows how asio::ssl::stream is moved from the server class to the session class. When I try to compile the example, it throws me an error: /home/user/tmp/tmp.ZxZvgK7sGZ/main.cpp: In constructor…
Drejc
  • 491
  • 6
  • 21
1
vote
1 answer

Linker error while I try to add asio to my C++ project

I have a following simple program: #include #include int main() { return 0; } And when I try to compile it with (mingw) I get the following error: C:\Users\Kamran\Desktop\Networking>g++…
milad
  • 11
  • 2
1
vote
0 answers

Thread-safe channel construct in Boost.ASIO with C++20 coroutines

I have been trying to implement a very basic thread-safe Go-like channel class with Boost.ASIO 1.78 and C++20 coroutines. Sending works without any problems until it hits the max_size limit. When the producer goes into the waiting state it won't…
terrakuh
  • 140
  • 7