boost-asio

For distributed applications, which to use, ASIO vs. MPI?

佐手、 提交于 2019-12-13 00:37:18
问题 I am a bit confused about this. If you're building a distributed application, which in some cases may perform parallel operations (although not necessarily mathematical), should you use ASIO or something like MPI? I take it MPI is a higher level than ASIO, but it's not clear where in the stack one would begin. 回答1: As far as I know MPI is currently incapable of handling the situation, when the new distributed nodes want to join the already started group. The problems also may occur if one of

boost::asio triggers a sigsegv in std::type_info::operator==

匆匆过客 提交于 2019-12-13 00:29:41
问题 So, I've got an application that uses boost::asio. Due to complexity of the project, I cannot share it's source code, sadly :( The application uses boost's asio lib to create some webservices. When attempting to use it, however, there's a sigsegv in std::type_info::operator==, which, as I'm aware, should rather work. (gdb) backtrace #0 0x0000000000457b79 in std::type_info::operator== ( this=0x7ffff6dadf61 <typeinfo for boost::asio::detail::typeid_wrapper<boost::asio::deadline_timer_service

boost::asio::async_write - ensure only one outstanding call

北战南征 提交于 2019-12-12 20:22:08
问题 According to the documentation: "The program must ensure that the stream performs no other write operations (such as async_write, the stream's async_write_some function, or any other composed operations that perform writes) until this operation completes." Does this mean, I cannot call boost::asio::async_write a second time until the handler for the first is called? How does one achieve this and still be asynchronous? If I have a method Send: //------------------------------------------------

Boost's ASIO + SSL don't work in some conditions

醉酒当歌 提交于 2019-12-12 19:41:06
问题 There is a client/server application written using Boost's ASIO (Boost v.1.48) + OpenSSL (v.1.0.0d). Complete OpenSSL (dynamic/static libraries and binaries) is custom built, the after-build tests are passed correctly and it links to the client and the server statically. ASIO code works in asynchronous mode. All ASIO's SSL contexts use the boost::asio::ssl::context::sslv23 method. The problem description is the following. Configuration 0 The server: works under Win7 Prof SP1 (Comp0). It uses

asio : multiple pending async_read?

落爺英雄遲暮 提交于 2019-12-12 18:22:58
问题 async_read calls the callback when the requested amount of bytes have been received. This may imply multiple calls to async_read_some. In the documentation it is specified that there can be at most one pending async_read_some. The callback has to be called before the next async_read_some may be issued. What about the async_read ? Can multiple async_read be queued ? If yes, is the order of execution guaranteed to be preserved ? 回答1: According to the documentation of async_read(...) This

Boost Asio async_wait handler

时间秒杀一切 提交于 2019-12-12 14:07:43
问题 The boost asio deadline_timer async_wait function is taking handler of the form : void handler(const boost::system::error_code& error) How could I define a handler which takes in const boost::system::error_code& error and also an argument of type int ? boost::asio::deadline_timer t(io_service); t.async_wait(handler); //I need the async_wait to take in handler which accepts argument boost::system::error_code& error and an int void handler(int, const boost::system::error_code& error )//extra

Boost.Asio documentation is non-existent. What do these errors mean?

家住魔仙堡 提交于 2019-12-12 11:12:18
问题 I'm struggling with two errors with Boost.Asio. The first occurs when I try to receive data on a socket: char reply[1024]; boost::system::error_code error; size_t reply_length = s.receive(boost::asio::buffer(reply, 1024), 0, error); if (error) cout << error.message() << endl; //outputs "End of file" The second occurs when I try to create an ip::tcp::socket from a (valid!) native socket: boost::asio::io_service ioserv; boost::asio::ip::tcp::socket s(ioserv); boost::system::error_code error; s

Should I choose Boost Asio or Aysnc Socket threads in Android?

会有一股神秘感。 提交于 2019-12-12 10:57:40
问题 I am in process of developing an network based UI app for Android which would perform following kind of functionalities Needs to communicate with TCP servers running on n/w based embedded devices (>100 at a time). Polling these devices at regular intervals for fetching updated information Sending and receiving information from those devices All above information would be controlled and managed by application's UI Considering above situations, the app would probably have to spawn multiple

Code using boost::asio::streambuf causes segfault

假装没事ソ 提交于 2019-12-12 10:47:05
问题 I've experienced problems using asio::streambuf and am hoping someone can tell me if I'm using the class incorrectly. When I run this example code it segfaults. Why? To make things more confusing, this code works on Windows (Visual Studio 2008), but does not work on Linux (with gcc 4.4.1). #include <boost/asio.hpp> using namespace std; int main() { boost::asio::streambuf Stream; // Put 4 bytes into the streambuf... int SetValue = 0xaabbccdd; Stream.sputn(reinterpret_cast<const char*>(

Google::protobuf + boost::asio failure

时光毁灭记忆、已成空白 提交于 2019-12-12 09:54:00
问题 I have studied the existing examples: Sending Protobuf Messages with boost::asio Reading Protobuf objects using boost::asio::read_async Google Protocol Buffers: parseDelimitedFrom and writeDelimitedTo for C++ Are there C++ equivalents for the Protocol Buffers delimited I/O functions in Java? Sending Protobuf Messages with boost::asio but I still can not figure out how to pass Google Protobuf messages using the Boost::asio API. In particular I have no clear understanding of the following