boost-asio

io_service , why and how is it used

Trying to learn asio, and I'm following the examples from the website. Why is io_service needed and what does it do exactly? Why do I need to send it to almost every other functions while performing asynchronous operations, why can't it "create" itself after the first "binding". ...

When to use asynchronous operations in asio

When should I use asynchronous operations in boost::asio instead of synchronous operations in seperate threads? ...

Is there a way to get Asio working without Boost?

I know there is a version of ASIO that is not included in the Boost namespace, but even then ASIO depends on Boost, but I'm wondering if there is a way to get ASIO to work without dependencies on Boost (because I cannot include Boost into the project, for too many reasons). ...

For boost-asio network programming whats the best approach for processing the response?

Im new to network programming and in particular to async-processes. Start also new with the boost-lib Im implementing a class, to access an imap-server. I can send and receive the commands and the response, in general The response is queued in a dequeue inside the class. I put simple the response lines in the queue, for further process...

Who uses Boost ASIO ?

I would like to know how popular is Boost ASIO. Is it being used in any popular network-intensive software ? ...

How to check if socket is closed in Boost.Asio?

What is the easiest way to check if a socket was closed on the remote side of the connection? socket::is_open() returns true even if it is closed on the remote side (I'm using boost::asio::ip::tcp::socket). I could try to read from the stream and see if it succeeds, but I'd have to change the logic of my program to make it work this way...

Copy a streambuf's contents to a string

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 want to copy the contents of the streambuf into a string, but it apparently only supports writing to char* (sgetn()), creating an istream with...

change the DCB structure of a boost::asio::serial_port

I'd like to disable RTSControl using boost::asio::serial_port set_option function. and also be able to raise or lower the DTR line? boost::asio::serial_port_base::baud_rate baud_option(115200); serialPort.set_option(baud_option); the standard options work great, but I can't figure out how to change the dcb structure, or how to co...

How do I send a std::vector<char> using Boost::Asio ?

I've been trying to achieve that for the better part of the day, I'd honestly apreciate any help. Both of my apps, the client and the server started throwing "vector subscript out of range" exceptions. How does one do this thing properly ? Still trying to figure this out, anyone? As far as I undestand I'm supposed to create a boost...

SCons, Boost::ASIO, Windows Precompiled Headers, and Linker Errors

I'm investigating using SCons for our build process as we develop C++ for multiple platforms. I'm 99% of the way there in the build configuration, but I'm running into a VERY strange error on Windows having to do with the precompiled header file. Even stranger still is that it only happens on one project. In the SConscript file for th...

How to integrate Boost.Asio main loop in GUI framework like Qt4 or GTK

Hello, Is there any way to integrate Boost.Asio with Qt4 (prefered) or GTK main loop? GTK provides poll(2) like API so technically is should be possible. Qt provides its own networking layer, however I prefer to use existing code written for Boost.Asio. I want to integrate them without using an additional thread. Is there any reference...

Boost::Asio::Ip::Tcp::Iostream questions

Hey all, I'm new to asio and boost, I've been trying to implement a TCP Server & Client so that I could transmit an std::vector - but I've failed so far. I'm finding the boost documentation of Asio lacking (to say the least) and hard to understand (english is not my primary language). In any case, I've been looking at the iostreams exam...

Boost asio ip tcp iostream Error Detection

Greetings. I'm just getting started with the boost::asio library and have run into some early difficulty related to boost::asio::ip::tcp::iostream. My question has two parts: 1.) How does one connect an iostream using simply host and port number? I can make the client and server [boost.org] examples work fine as coded. The server sp...

Boost linker error: Unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::get_system_category(void)"

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 compiles, and I pointed my project at the boost libraries (after having built x64 libs) and got past simple issues, now I am facing a linker erro...

boost asio: 0 byte write

Hi! I need some help understanding a peculiar issue I'm having when using asio. I've a client -server app, with a c++ client(using boost asio) sending 2 byte hearbeat (say, every second) to a server(written in java) (and receiving lots of data as well). for a quite a few minutes the server correctly receives the 2 byte HeartBeat...

boost::asio: How do I use async_accept to accept incoming connections?

I'm using boost::asio, and I have code like this: void CServer::Start(int port) { tcp::acceptor acceptor(m_IoService, tcp::endpoint(tcp::v4(), port)); for ( ;; ) { shared_ptr<tcp::socket> pSocket(new tcp::socket(m_IoService)); acceptor.accept(*pSocket); HandleRequest(pSocket); } } This code works, bu...

Resource temporarily unavailable in Boost ASIO

I get the error message "Resource temporarily unavailable" when I use the method receive_from(), it's a member of ip::udp::socket located here. I pass to it: boost::asio::buffer, pointer to an endpoint object, flags (set to zero), and an error_code object. I create the endpoint with just new udp::endpoint() There doesn't seem to...

Boost Asio dll raising ws2_32.dll error on Windows 2000

I have a dll that uses boost Asio for networking. When I link this dll to an application running on Windows 2000, a runtime exception is thrown: "The procedure entry point freeaddrinfo could not be located in the dynamic link library WS2_32.dll" Microsoft provides a workaround at http://msdn.microsoft.com/en-us/library/ms737931(VS.85)....

Sockets: How to send data to the client without 'waiting' on them as they receive/parse it

I have a socket server, written in C++ using boost::asio, and I'm sending data to a client. The server sends the data out in chunks, and the client parses each chunk as it receives it. Both are pretty much single threaded right now. What design should I use on the server to ensure that the server is just writing out the data as fast...

message order incorrect (using io_service::wrap)

Hi! I've an application to which a GUI connects and receives a lot of messages and the problem is that every once in a while it receives a message out of order. The connection runs on a separate worker thread (a separate io_service) and exposes the "send" function(which does a async__write) via io_service::wrap as a callback for others...