boost-asio Questions

4

As far as I know, the main difference between synchronous and asynchronous operations (i.e. write() or read() vs async_write() and async_read()) The former ones don't return until the operation fin...
Radio asked 12/3, 2011 at 13:5

3

Assertion failed: (id_ != T::id), function try_lock, file /usr/local/include/boost/beast/websocket/detail/stream_base.hpp, line 91. // Echoes back all received WebSocket messages class session : ...
Leopold asked 8/9, 2018 at 15:39

1

Solved

I was surprised to find that the code below works without passing io_context as the first argument to spawn. Could somebody please explain why I don't need to pass it in this case, and in what situ...
Matted asked 21/3, 2021 at 11:55

11

Solved

Apparently boost::asio::async_read doesn't like strings, as the only overload of boost::asio::buffer allows me to create const_buffers, so I'm stuck with reading everything into a streambuf. Now I ...
Countess asked 18/5, 2009 at 13:7

8

Solved

Do any asynchronous connectors exist for Mysql that can be used within a C or C++ application? I'm looking for something that can be plugged into a reactor pattern written in Boost.Asio. [Edit:] R...
Tussore asked 1/9, 2008 at 21:17

2

Solved

I want to do the following with Boost Asio. I have a socket and I want to register a callback to be called when data is available for reading/writing on the socket, but I don't want it to actually ...
Nardi asked 28/6, 2013 at 12:2

5

Solved

Is there any way to integrate Boost.Asio with Qt4 (preferred) or GTK main loop? GTK provides poll(2) like API so technically is should be possible. Qt provides its own networking layer, however I p...
Overcareful asked 16/6, 2009 at 11:57

1

Solved

I was writing some asio code and tried to refactor it to use C++20 coroutines. However I got stuck transforming this code: asio::post( my_strand, [self = shared_from_this()]() { // functions tha...
Windstorm asked 16/2, 2021 at 14:36

3

Solved

I'm trying to hack a client together in C++ using Google's Protocol Buffers and boost::asio. My problem is that I don't know how I can feed the protobuf message to asio. What I have is this: // s...
Obsess asked 26/1, 2011 at 21:6

3

I have a canned reproducer invoking boost::asio::ip::tcp::resolver::resolve() on localhost once every 5 seconds. It counts the number of endpoints returned and compares that value against the previ...
Confront asked 12/6, 2012 at 4:1

10

Solved

I'm just getting started with Boost for the first time, details: I'm using Visual Studio 2008 SP1 I'm doing an x64 Build I'm using boost::asio only (and any dependencies it has) My code now com...
Tineid asked 30/6, 2009 at 21:6

1

Solved

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 ca...
Sequester asked 23/9, 2020 at 14:29

2

Solved

I am currently trying to transfer some JSON data over the network from a client to a server using the socket API of boost-asio. My client essentially does this: int from = 1, to = 2; boost::asio:...
Slingshot asked 26/6, 2014 at 10:38

2

I want to create and connect to an unix domain socket of type SOCK_SEQPACKET by specifying the path name of the socket endpoint, but this fails to compile in boost::asio v1.60: using namespace boo...
Laplante asked 6/5, 2016 at 20:9

3

Solved

I am currently trying to use boost::asio for some simple tcp networking for the first time, and I allready came across something I am not really sure how to deal with. As far as I understand io_ser...
Schlosser asked 16/1, 2011 at 12:46

6

Solved

I ran across enable_shared_from_this while reading the Boost.Asio examples and after reading the documentation I am still lost for how this should correctly be used. Can someone please give me an e...
Isometrics asked 3/4, 2009 at 1:46

9

Solved

( This is a simplified version of my original question ) I have several threads that write to a boost asio socket. This seems to work very well, with no problems. The documentation says a shared...
Secondhand asked 9/9, 2011 at 14:6

1

Solved

I translated the example from Programming in Lua by Roberto Ierusalimschy for downloading several files via HTTP using coroutines to C++ using boost::asio and stackful coroutines. Here is the code:...
Granddaughter asked 15/8, 2016 at 15:45

5

Solved

I'm working on a multithreaded application in which one thread acts as a tcp server which receives commands from a client. The thread uses a Boost socket and acceptor to wait for a client to connec...
Priebe asked 25/6, 2012 at 14:15

1

I am making a client socket. To make things easier for my testers, I'd like to specify the network card and port that the socket will use. Yesterday, in my Google search, I found: Binding boost a...
Benham asked 27/6, 2017 at 16:12

1

Solved

I'm currently writing a multi-threaded server where each thread has an io_context and a list of task objects to execute, with each task object having an associated ip::tcp::socket object. For load...
Moyer asked 5/10, 2018 at 19:0

2

Solved

Studying boost asio and find out a class called "strand", as far as I understand. If there are only one io_service associated to a specific strand and post the handle by the strand. example(from h...
Skinner asked 18/8, 2014 at 13:2

1

Solved

Whats the difference between an asio::thread_pool and an asio::io_context whose run() function is called from multiple threads? Can I replace my boost::thread_group of threads that call io_context:...
Waisted asked 18/5, 2020 at 7:29

3

Solved

I am new to SSL and the Boost-Beast library, and also C++, but that's a different story. I have a question regarding using HTTPS (SSL) with Beast. I am going to use the library to connect to a RES...
Heavenward asked 27/3, 2018 at 8:1

1

Solved

I have been going throught the boost asio library in which most of the objects need the io_context object as argument to the constructor. I have read what io_context object,according to the documen...
Boric asked 2/4, 2020 at 17:53

© 2022 - 2024 — McMap. All rights reserved.