management: process Nack in nfd::Controller
refs #3264
Change-Id: Ifaa73ac04e8838a89708fc63a578941d700712c6
diff --git a/src/management/nfd-controller.cpp b/src/management/nfd-controller.cpp
index 733ca36..2ebdb4a 100644
--- a/src/management/nfd-controller.cpp
+++ b/src/management/nfd-controller.cpp
@@ -25,7 +25,8 @@
namespace ndn {
namespace nfd {
-const uint32_t Controller::ERROR_TIMEOUT = 10060;
+const uint32_t Controller::ERROR_TIMEOUT = 10060; // WinSock ESAETIMEDOUT
+const uint32_t Controller::ERROR_NACK = 10800; // 10000 + TLV-TYPE of Nack header
const uint32_t Controller::ERROR_SERVER = 500;
const uint32_t Controller::ERROR_LBOUND = 400;
@@ -50,6 +51,7 @@
m_face.expressInterest(interest,
bind(&Controller::processCommandResponse, this, _2,
command, onSuccess, onFailure),
+ bind(onFailure, ERROR_NACK, "network Nack received"),
bind(onFailure, ERROR_TIMEOUT, "request timed out"));
}
diff --git a/src/management/nfd-controller.hpp b/src/management/nfd-controller.hpp
index 331810f..4fbfa3e 100644
--- a/src/management/nfd-controller.hpp
+++ b/src/management/nfd-controller.hpp
@@ -84,10 +84,13 @@
public:
/** \brief error code for timeout
- * \note comes from http://msdn.microsoft.com/en-us/library/windows/desktop/ms740668.aspx
*/
static const uint32_t ERROR_TIMEOUT;
+ /** \brief error code for network Nack
+ */
+ static const uint32_t ERROR_NACK;
+
/** \brief error code for server error
*/
static const uint32_t ERROR_SERVER;