Change Transport connect to use the new ConnectionInfo object.
diff --git a/ndn-cpp/transport/tcp-transport.cpp b/ndn-cpp/transport/tcp-transport.cpp
index 248a613..757823d 100644
--- a/ndn-cpp/transport/tcp-transport.cpp
+++ b/ndn-cpp/transport/tcp-transport.cpp
@@ -12,21 +12,26 @@
namespace ndn {
-void TcpTransport::connect(Node &node)
+TcpTransport::ConnectionInfo::~ConnectionInfo()
+{
+}
+
+void TcpTransport::connect(const Transport::ConnectionInfo &connectionInfo, ElementListener &elementListener)
{
+ const TcpTransport::ConnectionInfo &tcpConnectionInfo = dynamic_cast<const TcpTransport::ConnectionInfo &>(connectionInfo);
+
ndn_Error error;
- if ((error = ndn_TcpTransport_connect(&transport_, (char *)node.getHost(), node.getPort())))
+ if ((error = ndn_TcpTransport_connect(&transport_, (char *)tcpConnectionInfo.getHost().c_str(), tcpConnectionInfo.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 *)
+ // Automatically cast elementReader_ to (struct ndn_ElementListener *)
ndn_BinaryXmlElementReader_init
- (&elementReader_, &node, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
+ (&elementReader_, &elementListener, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
- // TODO: Properly indicate connected status.
isConnected_ = true;
- node_ = &node;
+ elementListener_ = &elementListener;
}
void TcpTransport::send(const unsigned char *data, unsigned int dataLength)