In send, use const unsigned char *
diff --git a/ndn-cpp/transport/UdpTransport.cpp b/ndn-cpp/transport/UdpTransport.cpp
index ae0124f..42318aa 100644
--- a/ndn-cpp/transport/UdpTransport.cpp
+++ b/ndn-cpp/transport/UdpTransport.cpp
@@ -28,10 +28,10 @@
ndn_ = &ndn;
}
-void UdpTransport::send(unsigned char *data, unsigned int dataLength)
+void UdpTransport::send(const unsigned char *data, unsigned int dataLength)
{
ndn_Error error;
- if (error = ndn_UdpTransport_send(&transport_, data, dataLength))
+ if (error = ndn_UdpTransport_send(&transport_, (unsigned char *)data, dataLength))
throw std::runtime_error(ndn_getErrorString(error));
}
diff --git a/ndn-cpp/transport/UdpTransport.hpp b/ndn-cpp/transport/UdpTransport.hpp
index a24a4dc..eab7232 100644
--- a/ndn-cpp/transport/UdpTransport.hpp
+++ b/ndn-cpp/transport/UdpTransport.hpp
@@ -26,7 +26,7 @@
*/
virtual void connect(NDN &ndn);
- virtual void send(unsigned char *data, unsigned int dataLength);
+ virtual void send(const unsigned char *data, unsigned int dataLength);
virtual void tempReceive();