Pass host and port to NDN constructor and Transport::connect
diff --git a/ndn-cpp/transport/TcpTransport.cpp b/ndn-cpp/transport/TcpTransport.cpp
index 7a3a190..c3abab6 100644
--- a/ndn-cpp/transport/TcpTransport.cpp
+++ b/ndn-cpp/transport/TcpTransport.cpp
@@ -10,10 +10,10 @@
namespace ndn {
-void TcpTransport::connect(char *host, unsigned short port)
+void TcpTransport::connect(const char *host, unsigned short port)
{
ndn_Error error;
- if (error = ndn_TcpTransport_connect(&transport_, host, port))
+ if (error = ndn_TcpTransport_connect(&transport_, (char *)host, port))
throw std::runtime_error(ndn_getErrorString(error));
}
diff --git a/ndn-cpp/transport/TcpTransport.hpp b/ndn-cpp/transport/TcpTransport.hpp
index a8a354e..a5d0ca8 100644
--- a/ndn-cpp/transport/TcpTransport.hpp
+++ b/ndn-cpp/transport/TcpTransport.hpp
@@ -18,7 +18,7 @@
ndn_TcpTransport_init(&transport_);
}
- virtual void connect(char *host, unsigned short port);
+ virtual void connect(const char *host, unsigned short port);
virtual void send(unsigned char *data, unsigned int dataLength);
diff --git a/ndn-cpp/transport/Transport.cpp b/ndn-cpp/transport/Transport.cpp
index 950b1cb..84a4e02 100644
--- a/ndn-cpp/transport/Transport.cpp
+++ b/ndn-cpp/transport/Transport.cpp
@@ -10,7 +10,7 @@
namespace ndn {
-void Transport::connect(char *host, unsigned short port)
+void Transport::connect(const char *host, unsigned short port)
{
throw logic_error("unimplemented");
}
diff --git a/ndn-cpp/transport/Transport.hpp b/ndn-cpp/transport/Transport.hpp
index 85fe1b7..655ce6e 100644
--- a/ndn-cpp/transport/Transport.hpp
+++ b/ndn-cpp/transport/Transport.hpp
@@ -10,7 +10,7 @@
class Transport {
public:
- virtual void connect(char *host, unsigned short port);
+ virtual void connect(const char *host, unsigned short port);
virtual void send(unsigned char *data, unsigned int dataLength);