Select Default Language Display:

  • C++
  • Python
  • JavaScript
  • Java
  • All Languages

NetworkNack Class

A NetworkNack object represents a network Nack packet and includes a Nack reason. It is provided in the OnNetworkNack callback from Face.expressInterest.

[C++]:
#include <ndn-cpp/network-nack.hpp>
Namespace: ndn
[Python]:Module: pyndn
[Java]:Package: net.named_data.jndn

NetworkNack.getOtherReasonCode Method

Get the reason code from the packet which is other than a recognized Reason enum value. This is only meaningful if getReason() is OTHER_CODE.

[C++]:
int getOtherReasonCode() const;
[Python]:
# Returns int
def getOtherReasonCode(self)
[JavaScript]:
// Returns number
Interest.prototype.getOtherReasonCode = function()
[Java]:
public final int getOtherReasonCode()
Returns:

The reason code.

NetworkNack.getReason Method

Get the network Nack reason.

[C++]:
ndn_NetworkNackReason getReason() const;
[Python]:
# Returns int
def getReason(self)
[JavaScript]:
// Returns number
MetaInfo.prototype.getReason = function()
[Java]:
public final NetworkNack.Reason getReason()
Returns:

The reason enum value which is NONE, CONGESTION, DUPLICATE, NO_ROUTE or OTHER_CODE as follows. If this returns OTHER_CODE, then call getOtherReasonCode() to get the unrecognized reason code.

  • C++: ndn_NetworkNackReason_NONE, ndn_NetworkNackReason_CONGESTION, ndn_NetworkNackReason_DUPLICATE, ndn_NetworkNackReason_NO_ROUTE, ndn_NetworkNackReason_OTHER_CODE
  • Python, JavaScript, Java: NetworkNack.Reason.NONE, NetworkNack.Reason.CONGESTION, NetworkNack.Reason.DUPLICATE, NetworkNack.Reason.NO_ROUTE, NetworkNack.Reason.OTHER_CODE