Bug #1314
closedFace::checkPitExpire should not close transport
100%
Description
If the app isn't listening at any prefix, the transport is closed after all pending Interests are satisfied.
https://github.com/named-data/ndn-cpp-dev/blob/42c81850465c3db5ad68236afa308e89d3d383f9/src/face.cpp#L308
This behavior is undesirable for low traffic apps, such as ndn-tlv-ping who sends an Interest every 1 second and gets answered within 6 milliseconds.
The library closes the transport after each Interest is satisfied, which forces the forwarder to destroy and create face once per second, causing performance issues.
Updated by Alex Afanasyev over 11 years ago
I disagree (in general) with this. If application wants to keep transport open, it should do something to make it open. Right now it can be tricked by enabling listening on a specific prefix. I can add a separate method that allows transport to be persistent, but this definitely not the general case.
Btw. Which performance issues you're referring to? NFD performance or ping? It shouldn't be a big problem for NFD to create/destroy faces...
Updated by Junxiao Shi over 11 years ago
- Tracker changed from Task to Bug
Face setup/teardown is an expensive task on forwarder (both NFD and ndnd-tlv), compared to Interest/Data processing. Keeping faces open is cheap.
Steps on face setup:
- allocate Face object
- assign FaceId
- publish face create notification
Steps on face teardown:
- delete nexthop records for failed face
- publish face destroy notification
- deallocate Face object
Updated by Alex Afanasyev over 11 years ago
I'm not going to change the default behavior, since it is desired to close face when operation on face finishes (=outstanding interest satisfied). This is used by both test cases and should be used by client apps.
ping is really a special case, which needs to be always connected. I will make a separate call to allow face to be persistent.
Updated by Alex Afanasyev over 11 years ago
I'll check the possibility of using socket::cancel instead of close for Face::checkPitExpire. This way we wouldn't need special handling for ping.
Updated by Alex Afanasyev over 11 years ago
- Status changed from New to Code review
Updated by Junxiao Shi over 11 years ago
- Status changed from Code review to Closed
- % Done changed from 0 to 100