Thread: Boost.Asio's io_service and event handling

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Chris87's Avatar
    Join Date
    Dec 2007
    Posts
    139

    Boost.Asio's io_service and event handling

    I'm trying to figure out how to use Boost.Asio's network functionality so that I can make some server software. I'm learning how to do this by examining the C++11 chat server example found here and I seem to understand most of it. However, assuming io_service.run() is the catalyst for event loops, I'm not seeing anywhere how it yields a notification such as "oh, the client sent some data" or an event handler of any sort. What's more, it seems a lot like in the chat_session class, it defines what the client does with the data received from the server. I'm not writing a client program as well, only the server part. I should be able to code the server in such a way that it sends the client(s) data and let whoever writes the client manage what to do with it on their end, but I'm not seeing that in this example.

    I did this before successfully in Qt, but I've since been understanding Boost a lot better and wanted to try and write a less dependency-cluttered version. I know Boost has a signals library as well, but I wouldn't know how to entwine it with the Asio library in this case.
    Last edited by Chris87; 02-01-2016 at 03:25 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Converting From Boost::Asio::streambuf to a string
    By EverydayDiesel in forum C++ Programming
    Replies: 2
    Last Post: 01-07-2016, 11:26 AM
  2. Replies: 2
    Last Post: 04-14-2013, 12:25 PM
  3. Boost Asio and asynchronous I/O
    By Elysia in forum C++ Programming
    Replies: 9
    Last Post: 06-19-2011, 07:51 PM
  4. Open a serial port asynchronously with boost asio?
    By TriKri in forum C++ Programming
    Replies: 2
    Last Post: 05-16-2010, 12:33 PM
  5. Boost ASIO
    By PetrolMan in forum C++ Programming
    Replies: 0
    Last Post: 04-10-2009, 03:24 PM