Feature #2500
closed
Face constructor with default transport and custom io service
Added by Alex Afanasyev almost 10 years ago.
Updated almost 9 years ago.
Description
In some case, it may be necessary to use custom io_service
, but default transport for Face constructor (KeyChain can be also custom).
- Project changed from NFD to ndn-cxx
- Category set to Base
- Target version set to v0.4
Please be explicit about the use case.
When I added Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService, KeyChain& keyChain);
overload, it was decided that this overload allows all customization and no other overload is needed.
Until the use case arises, there is no way to know what exactly is needed. I got the issue when attempting to create face inside refactored NRD with customized keychain (this part will be needed for ndnSIM).
So, the use case is that application may want to have two faces (for some unspecified reason) and wants to shared the same io_service
, while using customized KeyChain. The current constructor allows that, but it requires explicitly creating transport, while some applications may want to use whatever is default.
Do you prefer to add a new constructor with
Face( boost::asio::io_service& ioService,
KeyChain& keyChain);
Or prefer to use the one from Note#2 and check if transport is nullptr?
- Tracker changed from Task to Feature
- Subject changed from Face missing constructor with default transport and custom io service to Face constructor with default transport and custom io service
Face(shared_ptr<Transport> transport, boost::asio::io_service& ioService, KeyChain& keyChain)
could be sufficient, provided that nullptr for the first parameter is treated as "use default transport".
- Status changed from New to Code review
- Assignee set to Alex Afanasyev
- % Done changed from 0 to 100
- Status changed from Code review to Closed
Also available in: Atom
PDF