Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
67 views

Consider the code #include <asio.hpp> asio::awaitable<void> doit(char ch) { for (int i = 0; i < 5; ++i) { fprintf(stderr, "%c %d\n", ch, i); asio::...
nunojpg's user avatar
  • 525
1 vote
1 answer
134 views

I have the following code using the C++ ASIO library that's intended to ensure messages are not interleaved on the socket being written to (as discussed here): #include <boost/asio.hpp> #include ...
jezza's user avatar
  • 482
8 votes
1 answer
164 views

In Linux OS's multithread process, the signal isn't guaranteed to deliver to specific thread. And I wonder, when I use asio::signal_set::async_wait. Is this asynchronous operation guaranteed to ...
Searcher's user avatar
  • 147
0 votes
0 answers
231 views

I'm trying to use asio::co_spawn with boost::future in Thread library, such that I could chain the co_routine task with then() function. But the problem is asio::use_future only generates std::future. ...
YzEdwin's user avatar
  • 21
0 votes
1 answer
111 views

The goal is to use NAudio, ASIO4ALL, WinUI 3 (a part of the Windows App SDK), and C#.NET in Visual Studio 2022 to make recordings. Unfortunately, such goal hasn't been reached as of yet. I based my ...
Giovanni Briones's user avatar
3 votes
1 answer
153 views

I'm building a client-server project using standalone Asio (C++20) and OpenSSL. My client uses asio::ssl::stream<asio::ip::tcp::socket> for TLS connections. After my client is done communicating ...
user avatar
-1 votes
1 answer
152 views

I am trying to build C++ code with ASIO and OpenSSL (on windows, without boost). I have been using ASIO no problem for a while now. However, I now tried to include "asio/ssl.hpp" and I get a ...
indjev99's user avatar
  • 122
3 votes
1 answer
74 views

There is a test code for main, It's pretty simple. void AddData(std::shared_ptr<std::queue<std::string>> stores) { stores->push("A\n"); stores->push("B\n")...
user29207775's user avatar
2 votes
1 answer
219 views

I have a class that wraps a boost::asio::serial_port on a Windows system. I use it to start asynchronous reads on a supplied buffer. It works well in most cases when there is data in the queue before ...
SupAl's user avatar
  • 1,131
3 votes
0 answers
182 views

I am using asio/beast for tcp ssl connections. Calling async_read in a loop inside corouties. In situations when I have N packets on websocket I need to do N async_reads to drain the websocket. This ...
Eduard Rostomyan's user avatar
0 votes
0 answers
53 views

When using asynchronous programming, the life cycle is always particularly complex. In order to control the life cycle effectively, I always try to use smart pointers to encapsulate all the objects ...
vipcxj's user avatar
  • 1,108
2 votes
1 answer
318 views

When I use the following code, it spawns a new thread. resolver_.async_resolve( host_, port_, beast::bind_front_handler(&session::on_resolve, shared_from_this())); But when I change ...
berkeyvx's user avatar
3 votes
1 answer
58 views

Everything is handle in a single thread void GameClient::test() { std::cout <<"called test" << std::endl; m_io_context.post([](){ std::cout << "test&...
Nathan's user avatar
  • 55
2 votes
1 answer
156 views

I am implementing a very simple UDP client using the Boost ASIO library with C++20 coroutines. To try to gain a little performance cheaply, I am trying to use a concrete executor type asio::io_service:...
Matus Novak's user avatar
3 votes
1 answer
203 views

I was looking at the documentation provided by Boost regarding how to realize TCP async client/server (echo server, chat, and so on), but I didn't find anything related to managing the async read and ...
And.Re's user avatar
  • 55
2 votes
1 answer
141 views

I'm using an ASIO component (in Delphi 7) which supports only 16-bit and 32-bit output when it deinterleaves the left/right channels into 2 separate ASIO buffers. Some ASIO drivers only support 24-bit ...
Ross's user avatar
  • 323
1 vote
1 answer
101 views

While transferring data over named pipes I need to serialize some data structure and then transmit a sequence consisting of the size in bytes of the serialized structure as a uint32_t followed by the ...
chili's user avatar
  • 748
0 votes
0 answers
51 views

To handle timeouts, let's assume I set up a steady_timer to go off right before async_resolve, async_connect, async_write, async_read_some... When the timer fires, I shutdown & close the socket. ...
equipped_mandingo's user avatar
1 vote
1 answer
131 views

I am trying to move away from using Visual Studio and use command-line compilation more, however I am having an issue with a project that uses ASIO in its header-only, standalone (non-boost) form ...
RRKS101_1 TF2's user avatar
0 votes
1 answer
364 views

I want to access the list of driver's names with the C++ ASIO SDK of Steinberg to select the driver then load it. So I try to use the hostsample.cpp exemple to write my code, it compile but dont want ...
lost_in_nowhere7's user avatar
0 votes
1 answer
794 views

I want to compile a simple program using ASIO SDK, however there is a strange error that I cannot fix. #include "asio.h" int main(void) { ASIODriverInfo info {}; ASIOInit(&info)...
lost_in_nowhere7's user avatar
3 votes
1 answer
367 views

I'm trying to build an audio application with cpal on Windows. With the Wasapi driver I got everything to work fine, but with ASIO only the outputs work, I can't get any input signals. I modified the ...
sternmull's user avatar
1 vote
1 answer
67 views

I'm new to asio and was follwing a tutorial. After sending a pretty basic http get request to example.com there is no response. #include<json/json.h> #include<asio/ts/buffer.hpp> #include&...
coffy_mug's user avatar
4 votes
1 answer
234 views

I've read this Q&A. Lambda lifetime explanation for C++20 coroutines If I understand correctly, lambda expression with capture something is not safe if the lambda expression is used as coroutine ...
Takatoshi Kondo's user avatar
2 votes
1 answer
120 views

I'm trying to send messages via async_write, but they are only sent after I shutdown the server ( ctrl-c) For example: as client I send "test" and "test2", and only after closing ...
kotivas's user avatar
  • 23
-1 votes
1 answer
122 views

I am currently trying to communicate from Unreal Engine 5 with an existing piece of software we have running at our company. This software accepts TCP connections. Since it seems to be the de-facto ...
Piflik's user avatar
  • 349
1 vote
1 answer
100 views

this is what my fileCollector looks like, it just stores a "cache" of files (so that you don't read the file during each request) class FileCollector { public: FileCollector()...
Simple Boy's user avatar
0 votes
1 answer
130 views

I'm using JSON to pass messages between a server and a client, both written in C++. To get a performance boost, I'm evaluating compression, as well as binary formats (like MessagePack). I started with ...
DarkRise's user avatar
1 vote
2 answers
279 views

I'm just learning boost.asio and decided to try to learn how to work with cmake as well, but my IDE swears at the async_wait function my code looks like this #include <boost/asio.hpp> #include &...
zxctatar's user avatar
  • 133
1 vote
2 answers
2k views

Win12, boost::asio 1.82.0, MSVC 2022 (I used different compilers, c++ 14 and c++ 20) I try to understand iocontext step by step. Now I want to use many threads (but I don't want to use thread pool yet,...
Valentyn Vovk's user avatar
1 vote
1 answer
162 views

I try to understand how iocontext works and created a simple program to understand its better step by step. As you can see, I even not to run ioc.run(). And I believed this code would do nothing. But ...
Valentyn Vovk's user avatar
2 votes
1 answer
184 views

I am working on a C++ client/server application with standalone asio without boost. I want the client application to continuously get responses from the server and send requests to the server when a ...
Leka's user avatar
  • 23
1 vote
0 answers
223 views

I'm working on a async udp server for a multiplayer game. It is a personal project and for education. I'm using ASIO standalone and C++20, mainly relying on coroutines. For the past couple of days I'...
Lucas6y6's user avatar
1 vote
1 answer
702 views

I am currently learning how to use the concurrent_channel provided in boost asio. Unfortunately, there are no usage examples for concurrent_channel in boost asio, so I'm trying to write some demos ...
sheldon's user avatar
  • 35
3 votes
1 answer
95 views

I want the second timer to start working half a second after the second one, but the moment the second timer starts working, the terminal displays something completely different from what I want. If ...
zxctatar's user avatar
  • 133
1 vote
1 answer
90 views

The link I'm using for the asio code is https://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/tutorial/tutdaytime1.html #include <iostream> #include <boost/asio.hpp> #include <boost/...
sea's user avatar
  • 77
3 votes
1 answer
538 views

Question I want to treat connection classes that has same signature member functions. For example, both tcp and tls are kind of connection class. They have send() member function template that ...
Takatoshi Kondo's user avatar
0 votes
1 answer
303 views

I'm trying to add CppServer from https://github.com/chronoxor/CppServer as a dependency to my cpp meson project and I'm trying to run the asio server/client example from https://github.com/chronoxor/...
ufk's user avatar
  • 32.4k
1 vote
1 answer
112 views

Overview When I use BoostAsio's CompletionToken facility, I design that completion_handler generated from CompletionToken finally invoked. But I am interested in the behavior if completion_handler is ...
Takatoshi Kondo's user avatar
1 vote
1 answer
319 views

I want to send two files to the client, the first file is img.jpg and the second file is message.txt The first file img.jpg is received correctly, but the file message.txt is received with size zero ...
boost's user avatar
  • 13
0 votes
0 answers
19 views

Operating system: 6.1.0-12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.52-1 (2023-09-07) x86_64 GNU/Linux What I'm trying to do: I'm trying to build one of this asio samples: https://github.com/...
0x90h's user avatar
  • 21
0 votes
1 answer
72 views

I am trying to bind a callback function with asio async_read_some function. Here is the code I tried to bind callback function for async reading. #include <chrono> #include <iostream> #...
Kyuhyong You's user avatar
1 vote
1 answer
1k views

Background I'm using Boost.Asio. I call multiple asynchronous functions, then I want to wait multiple CompetionToken. For example, async_read() and steady_timer::async_wait(). I implemented it using ...
Takatoshi Kondo's user avatar
-2 votes
1 answer
67 views

In this example : https://www.boost.org/doc/libs/1_83_0/doc/html/boost_asio/tutorial/tutdaytime3.html#boost_asio.tutorial.tutdaytime3.removing_unused_handler_parameters It is written : You may have ...
hl037_'s user avatar
  • 3,947
1 vote
1 answer
113 views

If the server starts after the connection cannot be reached.why? boost_1_73_0、Linux operating system #include "boost/asio.hpp" #include "boost/asio/spawn.hpp" int main() { ...
an e's user avatar
  • 11
2 votes
2 answers
651 views

I have an asynchronous operation by an external library that I can't change, but I can give a callback to. I want to wait for it to finish but without blocking the io_context. Something like: // ...
neucer's user avatar
  • 31
0 votes
1 answer
73 views

I am migrating old c++ code to more modern c++ with ASIO and i have a problem which i'm not sure how to solve with ASIO. The general ideia is: Act as Client and ...
eniac's user avatar
  • 63
1 vote
1 answer
116 views

I have a problem that when I call async_read I don't know the exact data type which a user sent so I need to retrieve it from the asio::streambuf and pass it to the asio::buffer_cast template. Also we ...
Jésus Christophe's user avatar
1 vote
1 answer
103 views

I'm trying to download any files from server - images, text/html, zip etc. But somehow I have some trash in the beginning and at the end of my output file. #include "dependencies.h" asio::...
bergemon's user avatar
0 votes
1 answer
153 views

After checking out this link: Writing multiple wav files from NAudio asioOut, I wanted to be able to get separate wave samples into different files, but it's not working. I'm only getting zero-byte ...
Timothy Ayodele's user avatar

1
2 3 4 5
11