Added Node class, and move most functionality from Face to Node. Make connect take a Node, not a Face.
diff --git a/ndn-cpp/transport/tcp-transport.cpp b/ndn-cpp/transport/tcp-transport.cpp
index aa438bc..a0a53de 100644
--- a/ndn-cpp/transport/tcp-transport.cpp
+++ b/ndn-cpp/transport/tcp-transport.cpp
@@ -4,7 +4,7 @@
*/
#include <stdexcept>
-#include "../face.hpp"
+#include "../node.hpp"
#include "../c/util/ndn_realloc.h"
#include "tcp-transport.hpp"
@@ -12,20 +12,20 @@
namespace ndn {
-void TcpTransport::connect(Face &face)
+void TcpTransport::connect(Node &node)
{
ndn_Error error;
- if ((error = ndn_TcpTransport_connect(&transport_, (char *)face.getHost(), face.getPort())))
+ if ((error = ndn_TcpTransport_connect(&transport_, (char *)node.getHost(), node.getPort())))
throw std::runtime_error(ndn_getErrorString(error));
// TODO: This belongs in the socket listener.
const unsigned int initialLength = 1000;
// Automatically cast ndn_ to (struct ndn_ElementListener *)
ndn_BinaryXmlElementReader_init
- (&elementReader_, &face, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
+ (&elementReader_, &node, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
// TODO: Properly indicate connected status.
- face_ = &face;
+ node_ = &node;
}
void TcpTransport::send(const unsigned char *data, unsigned int dataLength)