Don't pass a Closure to the NDN constructor
diff --git a/ndn-cpp/NDN.cpp b/ndn-cpp/NDN.cpp
index 5a3d829..20609fe 100644
--- a/ndn-cpp/NDN.cpp
+++ b/ndn-cpp/NDN.cpp
@@ -18,6 +18,9 @@
vector<unsigned char> encoding;
interest.encode(encoding);
+ // TODO: This should go in the PIT.
+ tempClosure_ = closure;
+
transport_->connect(*this);
transport_->send(&encoding[0], encoding.size());
}
diff --git a/ndn-cpp/NDN.hpp b/ndn-cpp/NDN.hpp
index 4b8e961..8f6f7bb 100644
--- a/ndn-cpp/NDN.hpp
+++ b/ndn-cpp/NDN.hpp
@@ -17,8 +17,8 @@
class NDN : public ElementListener {
public:
- NDN(const ptr_lib::shared_ptr<Transport> &transport, const char *host, unsigned short port, const ptr_lib::shared_ptr<Closure> &tempClosure)
- : transport_(transport), host_(host), port_(port), tempClosure_(tempClosure)
+ NDN(const ptr_lib::shared_ptr<Transport> &transport, const char *host, unsigned short port)
+ : transport_(transport), host_(host), port_(port)
{
}
diff --git a/tests/test-get-async.cpp b/tests/test-get-async.cpp
index 5d541a9..de687ab 100644
--- a/tests/test-get-async.cpp
+++ b/tests/test-get-async.cpp
@@ -36,7 +36,7 @@
{
try {
ptr_lib::shared_ptr<TcpTransport> transport(new TcpTransport());
- NDN ndn(transport, "E.hub.ndn.ucla.edu", 9695, ptr_lib::make_shared<MyClosure>());
+ NDN ndn(transport, "E.hub.ndn.ucla.edu", 9695);
ndn.expressInterest(Name("/ndn/ucla.edu/apps/ndn-js-test/hello.txt/level2/%FD%05%0B%16%7D%95%0E"), ptr_lib::make_shared<MyClosure>(), 0);
transport->tempReceive();