boost-asio

Extend asynchronous file io in boost::asio to Mac OS X

╄→гoц情女王★ 提交于 2019-12-04 14:53:08
The boost::asio package contains classes for doing asynchronous file io in Windows using IO completion ports. To my understanding, there is no support for asynchronous file io for other platforms included in the asio package. I am wondering what would need to be done in order to extend asio with asynchronous file io support for at least Mac OS X, but also to some extent Linux. I am mostly interested in what would need to be done on the asio side of things, but since I am not that experienced with Mac OS X programming I don't mind pointers on where to find more information on how to do

Create a layer 2 / ethernet socket with boost asio raw socket (in C++)

时间秒杀一切 提交于 2019-12-04 13:46:17
问题 It is fairly easy to create IP, TCP or UDP sockets using boost::asio library. But when it comes to Ethernet sockets for instance, you need to implement boost/asio/basic_raw_socket.hpp As there are no examples of such a thing over the internet and as I spent a long time before finding the answer, I'll put my work-around in here. The most helpful resource I found was: AF_NETLINK (netlink) sockets using boost::asio 回答1: A raw socket can be opened using the generic::raw_protocol stuff: std:

Having a hard time understanding a few concepts with Boost ASIO TCP with async_read and async_write

泄露秘密 提交于 2019-12-04 13:39:33
问题 I'm having a hard time understand the correct way I should structure a tcp client when using async_read and async_write. The examples seem to do a async_read after connecting and then have async_write in the handler. In the case of my client and sever, when the client connects it needs to check a queue of messages to write and check to see if anything needs to be read. One of the things I'm having a hard time with is understanding how this would work asynchronously. What I envision is in the

How to use boost asio library with Cygwin 64 bit

萝らか妹 提交于 2019-12-04 13:35:15
I am running Windows 10 64bit. Cygwin is 64 bit. I installed boost from cygwin package manager. I tried to compile test.cpp: #include <boost/asio.hpp> int main(int argc, char**argv) { return 0; } using command g++ -std=c++11 -Wall -g -D__USE_W32_SOCKETS D_WIN32_WINNT=_WIN32_WINNT_WIN7 test.cpp -o test.exe but compile fails. It looks like posix is being used . Any ideas why this fails? In file included from /usr/include/boost/asio/detail/fd_set_adapter.hpp:22:0, from /usr/include/boost/asio/detail/select_reactor.hpp:27, from /usr/include/boost/asio/detail/reactor.hpp:29, from /usr/include/boost

Whether there is a UDT backend for boost::asio?

拟墨画扇 提交于 2019-12-04 13:14:46
问题 Please, tell to me are whether exist UDT protocol backend for boost::asio? UDT is a reliable UDP based application level data transport protocol for distributed data intensive applications over wide area high-speed networks. ( http://udt.sourceforge.net/index.html ) 回答1: TCP, UDP, and ICMP are supported by Boost.Asio. Other protocols can be implemented by extending the Protocol type requirements. There are several threads on the asio-users mailing list discussing adding support for SCTP, you

C++ Multithreaded server help

柔情痞子 提交于 2019-12-04 13:14:32
I'm working on a multithreaded server in c++ using boost-asio. Currently a design problem I'm running into deals with erasing a connection. I have a single server instance which holds a vector of connection objects. These connections receive commands which I parse. One command in particular deals with sending data to ALL connections in my vector. Now when a connection disconnects I'm currently erasing this connection from the vector and calling the destructor. It seems like I'm going to run into problems when someone 'SendAll' at the same time someone 'Disconnect'. Could anyone recommend a

How to design a custom IO object for Boost.Asio

北城以北 提交于 2019-12-04 13:09:00
问题 I have an base class (DeviceBase) representing an embedded device, with which I want to communicate. The device can be accessed in various ways, including USB and TCP sockets. Additionally, there is a mock implementation which works on files. Until now, I have only used synchronous read/write calls, and all the implementations are simply classes derived from the base class, overriding the read/write functions. This allows me to use polymorphic pointers and containers to provide implementation

Help streaming over http in C++

痞子三分冷 提交于 2019-12-04 13:08:33
I'm looking to use a web service that offers a streaming api. This api can typically be used by the java method java.net.URL.openStream(); Problem is I am trying to design my program in C++ and have no idea what libraries (I've heard the cUrl library is very good at this sort of thing) to use, or how to use them to do what I want. The idea is that after opening the file as a stream I can access continually updating data in realtime. Any help would be much appreciated. Boost.Asio socket iostreams seem to be what you're after. Your code will look like this: ip::tcp::iostream stream("www

TCP Zero copy using boost

爱⌒轻易说出口 提交于 2019-12-04 12:13:56
问题 I am trying to implement tcp zero copy using boost but i am not able to find anything on google .My question is it possible to perform zero copy using boost libraries and if so please send me some example or some link. 回答1: You could watch this BoostCon talk by the Yandex guys: The Optimization of a Boost.Asio-based Networking Server My gut feeling says they (the Yandex guys) overengineered this (quite a bit...). I'd say the essential solution would lie in just using pre-allocated fixed