lundi 30 avril 2018

Boost Asio share same io_service along disposible objects

I'm developing a program, which consists of bunch of Active Objects, that sending messages to each other. I'm using one same io_service to initialize all these objects. So they're working to end of the software life.

I'm using the Active Objects to ,let's say, one for file operation, another for serial IO, another for local database connection and one to communicate all of these.

However I couldn't be sure about the objects with short lives. I'm using the short lived objects to open tcp socket to send a quick message to a remote endpoint then dispose the socket immediately. I'm thinking to make these also asynchronous.

The question is, should I use the same io_service for these short lived objects or should I create a new io_service for each socket ?

Aucun commentaire:

Enregistrer un commentaire