Task #4636
closed
Modify docs to show producers unregistering prefixes to shut down faces
Added by Eric Newberry over 6 years ago.
Updated over 6 years ago.
Description
As discussed at the NDN Platform Call on June 11, the ndn-cxx documentation, including examples, needs to be modified so that producers are shown shutting down faces by unregistering all prefixes, instead of calling Face::shutdown()
. This will ensure that the last sent Data packet is actually transmitted before the face shuts down.
- Related to Task #4642: Update producers across platform to unregister prefixes instead of shutting down face added
- Priority changed from Normal to High
The existing producer example in ndn-cxx doesn't shut down its face, except in response to a prefix registration error, where Face::unsetInterestFilter()
would be of no use. Does it need to be modified at all?
Also, I can't find any specific references to Face::shutdown()
in the ndn-cxx documentation. Even so, we should probably add something about the proper way to shut down a face on a producer.
- Status changed from New to Code review
- % Done changed from 0 to 100
“Waiting for processEvents() to exit” isn’t a proper solution when multiple faces are tied to the same io_service. Is there another way?
I’m suspecting the m_transport.close() line in Face::asyncShutdown(). StreamTransportImpl::close() clears the transmission queue, and packets could be lost there.
Junxiao Shi wrote:
“Waiting for processEvents() to exit” isn’t a proper solution when multiple faces are tied to the same io_service. Is there another way?
I’m suspecting the m_transport.close() line in Face::asyncShutdown(). StreamTransportImpl::close() clears the transmission queue, and packets could be lost there.
So do we need to modify the code to prevent this issue, instead of just shifting to unsetInterestFilter?
- Status changed from Code review to Closed
The relevant change was merged.
@Junxiao, feel free to move this to "Feedback" if you think more discussion of note 6 is warranted.
Junxiao Shi wrote:
“Waiting for processEvents() to exit” isn’t a proper solution when multiple faces are tied to the same io_service.
Is there a use case for employing multiple Face
instances in the same application? If an application really wants to do what you're saying, it should call run()
/stop()
/reset()
/etc.. on the io_service
directly, and not use Face::processEvents()
and shutdown()
.
Also available in: Atom
PDF