Actions
Task #2793
closedpingserver: refactor for separate responsibility
Start date:
Due date:
% Done:
0%
Estimated time:
4.00 h
Description
Refactor ndnpingserver
program to use the following structure:
|------------|
Face <- | | -> Tracer
| PingServer |
Options -> |
|------------|
- An
Options
POD struct contains parameters parsed from command line. PingServer
class constructor should takeFace&
andOptions
as argument; getter/setter for each option are deleted from the class.PingServer::run
returns when expected number of Interests are processed (if a limit is specified inOptions
).PingServer
class shouldn't write to stdout directly; instead, it emits a signal for each processed Interest.- A
Tracer
class connects to the signals, and writes logs for each processed Interest.
Benefits:
- separate responsibility:
PingServer
performs network operations,Tracer
writes logs. - unit testing: passing DummyClientFace to
Ping
constructor allows unit testing. - simulation:
PingServer
can be reused in a ndnSIM scenario.
Updated by Junxiao Shi over 9 years ago
- Blocks Feature #2796: Tests for Ping and PingServer added
Updated by Eric Newberry over 9 years ago
- Status changed from New to Code review
Updated by Alex Afanasyev over 9 years ago
Junxiao, can you comment on http://gerrit.named-data.net/#/c/2024/ ?
Updated by Eric Newberry over 9 years ago
- Status changed from Code review to Closed
Actions