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

Crash when sending data using async_write_some

My server has been running for more than 20 hours for a long time. During this period, I stress test the server uninterruptedly. Sometimes it crashes, sometimes it does not crash. I am using Asio only Asio Only Source Code to handle my network…
Doraemon
  • 11
  • 2
1
vote
0 answers

Can't restrict cipher for SSL/TLS in boost::asio

I am trying to deny some ciphers from usage. My code can be summed up as: boost::asio::ssl::context mSSLContext( aIOService, boost::asio::ssl::context::tlsv12_server ); mSSLContext.set_password_callback( boost::bind( &Server::getSSLPassword, this )…
teoring
  • 115
  • 13
1
vote
1 answer

Boost asio tcp data lost between packet when sending large data

I try to send a large data (1mb+) from a server to a client using the boost's asio library. I split the data into chunks of size 16000 and use async_write_some to send them. I read the data with async_read or async_read_some in the client. When both…
asmbaty
  • 436
  • 2
  • 11
1
vote
1 answer

What is asio::io_service?

I am studying asynchronous I/O. i knows about select(), poll(), and epoll(). What I'm curious about is asynchronous I/O when using boost::asio. as a result of investigation, io_service is used. Which one of select(), poll(), and epoll?
Hwan E
  • 566
  • 2
  • 13
1
vote
1 answer

What is the condition for completion handler of basic_stream_socket::async_write_some to be called?

The documentation for basic_stream_socket::async_write_some states, that the completion handler is called "when the write operation completes". But what exactly does that mean? I can think at least of two things when the kernel (networking stack in…
shylent
  • 10,076
  • 6
  • 38
  • 55
1
vote
1 answer

boost::asio::async_accept the handler is not called

took example from boost https://www.boost.org/doc/libs/1_70_0/doc/html/boost_asio/example/cpp11/ssl/server.cpp exactly as it is assembled it started it works. then took the implementation from the interface to SSL_Server.h, SSL_Server.cpp,…
kapusta
  • 13
  • 3
1
vote
1 answer

boost::asio UDP Broadcast Client Only Receives "fast" Packets

I have written a UDP Broadcast client using boost::asio. It works, but with a caveat. If I send packets very fast (at least one every 100ms or so), it seems to receive all of them. However, if I send only a single packet, it doesn't seem to catch…
DiB
  • 554
  • 5
  • 19
1
vote
1 answer

Default SSL cert dir

I have added support for loading HTTPS sites using asio following the example in the documentation which means I call ctx.set_default_verify_paths(); to use the systems default paths for finding the certificates. However with this I am getting:…
Zitrax
  • 19,036
  • 20
  • 88
  • 110
1
vote
2 answers

UDP: How make the data flow rate smooth for UDP packets over a network connection

Scenario: Using Boost Asio 1.69 I have a C++ server running on Linux Fedora 4.9 and a client running on an Android 10 phone using a peer to peer connection. There is continuous sending of data from server to client and occasionally a packet from…
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
1
vote
1 answer

boost::asio data owning `ConstBufferSequence`

The last days, I read alot through the asio examples and other questions here on SO regarding lifetime management of buffers passed to asios initiating functions. One issue that strikes me, is that there seems to be no "by value" solution, but…
Marti Nito
  • 697
  • 5
  • 17
1
vote
1 answer

Boost Asio tcp::iostream construction raise an Access Violation Exception on every second use

I am trying to use the implementation of std::iostream provided by boost::asio on top of boost::asio::ip::tcp::socket. My code replicate almost line to line the example that is published in Boost Asio's documentation: #include #include…
thulke
  • 11
  • 2
1
vote
0 answers

Asio read txt file from web server

Introduction What I want to do: I want get text from file which is on server. Imagine: a pseudo code connectTo("https://www.boost.org/LICENSE_1_0.txt"); std::string result = connectTo.GetResult(); std::cout << result; and I should get: Boost…
Wanderer
  • 319
  • 1
  • 3
  • 12
1
vote
1 answer

How to use Asio library to continuosly send large amount of byte over UDP (C++)

I'm trying to send an image (called frame) using an UDP socket over ethernet using the standalone ASIO library (C++). I have an infinite loop that runs 30 times per second and, at each iteration, I'd like to send the frame over UDP. Frames are…
F. DePa
  • 143
  • 1
  • 1
  • 8
1
vote
1 answer

How thread-safe is boost::asio?

I have an io_context that is run by multiple threads. I'm using sockets and timers. I know that I need to wrap all async_writes by a strand to prevent concurrent writes to the socket. But can two threads concurrently access the socket to issue an…
1
vote
0 answers

boost::asio - can't set keepalive value

I have copied the chat-example from the boost examples. server code: https://www.boost.org/doc/libs/1_53_0/doc/html/boost_asio/example/chat/chat_server.cpp chat_message.hpp:…
DasElias
  • 569
  • 8
  • 19