Ejemplo n.º 1
0
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_.get(), (char *)tcpConnectionInfo.getHost().c_str(),
        tcpConnectionInfo.getPort(), &elementListener)))
    throw runtime_error(ndn_getErrorString(error));

  isConnected_ = true;
}
Ejemplo n.º 2
0
ndn_Error
TcpTransportLite::connect
(const char* host, unsigned short port, ElementListenerLite& elementListener)
{
    return ndn_TcpTransport_connect(this, host, port, &elementListener);
}