boost-asio

Boost error codes reference

Does anyone know where to find a reference for boost error codes. In particular, error codes returned by asynchronous socket handlers?, Google and grepping the header files have tuned up empty. Thanks. ...

boost.asio error on read from socket.

The following code of the client: typedef boost::array<char, 10> header_packet; header_packet header; boost::system::error_code error; ... /** send header */ boost::asio::write( _socket, boost::asio::buffer(header, header.size()), boost::asio::transfer_all(), error ); /** send body */ boost::asio::w...

Problem compiling boost.asio example on AIX with IBM Visual Age C++ 7.0

This is definitely going to be one of my more arcane questions, but I hope someone has had to deal with this pain. I am porting some software to IBM AIX 5.3, using IBM VisualAge C++ 7.0 compiler. The source code depends on boost.asio for networking, and when I was building the code, I got an error from the source: include/boost/asio...

How does Boost ASIO receive_from return underlying socket errors?

i.e. will the blocking version return -1 on error. Or more to the point, how do you know the call failed? does boost::asio::ip::udp::socket::receive_from() return -1 on error The normal BSD socket API receive_from call will return -1 on errors and you can look at errno for the specific error code. Does the boost version do the same?...

Boost.Asio: Operation Cancelled on async_read

Another one in the continuing saga of myself vs. Boost.Asio... I have a simple asynchronous client and server that utilise async_write and async_read to communicate. The client can successfully write bytes to the socket, but the server never sees them; my read handler on the server fails with "Operation cancelled". I'm inclined to beli...

how to resolve ftp site using boost.asio?

Hello: Boost.asio documentation doesn't support any ftp examples. `boost::asio::io_service io_service; tcp::resolver resolver(io_service); tcp::resolver::query query("www.boost.org", "http"); tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);` that resolve http site and get an HTTP endpoint. but tcp::resolver::que...

Send data with boost::asio::socket_base.

Why does socket_base not have a send() method? Basically, I would like to use boost::asio's sockets like linux socket descriptors: whether the underlying socket is UDP or TCP it doesn't matter, you can call read(), write(), sendto(), etc... on them. Is there a more proper solution than just writing a wrapper class around asio's udp & tc...

C++ event processing

Hello. I am using the excellent asio for an asynchronous network client. When handling read (async_read) I am concerned that the method/function handling the data might hang or take too long (the function is supplied by the user of the class). What is the best way of calling the supplied function and ensuring it won't take too long ? ...

unget bytes to boost::asio::ip::tcp::socket

I need the two bytes to be read from the socket, and, if necessary, bring them back into the socket, so the next handler read them. how it can be implemented? Thanks. ...

Continuous boost::asio reads

Hi all, I'm experimenting with Boost::asio, and I'm trying to make a client that reads and outputs to console packets sent from a server. The server uses a proprietary protolcol. It sends a timer update every second, responds to ping, and can reply with a list of files when the client asks for it. I have a decent grasp of asynchronous n...