/**
 * @author: Jeff Thompson
 * See COPYING for copyright and distribution information.
 */

#ifndef NDN_TCPTRANSPORT_HPP
#define NDN_TCPTRANSPORT_HPP

#include "../c/transport/tcp-transport.h"
#include "../c/encoding/binary-xml-element-reader.h"
#include "transport.hpp"

namespace ndn {
  
class TcpTransport : public Transport {
public:
  TcpTransport() 
  : node_(0)
  {
    ndn_TcpTransport_init(&transport_);
    elementReader_.partialData.array = 0;
  }
  
  /**
   * Connect to the host specified in node.
   * @param node Not a shared_ptr because we assume that it will remain valid during the life of this Transport object.
   */
  virtual void connect(Node &node);
  
  /**
   * Set data to the host
   * @param data A pointer to the buffer of data to send.
   * @param dataLength The number of bytes in data.
   */
  virtual void send(const unsigned char *data, unsigned int dataLength);

  /**
   * Process any data to receive.  For each element received, call node.onReceivedElement.
   * This is non-blocking and will return immediately if there is no data to receive.
   * You should normally not call this directly since it is called by Face.processEvents.
   * @throw This may throw an exception for reading data or in the callback for processing the data.  If you
   * call this from an main event loop, you may want to catch and log/disregard all exceptions.
   */
  virtual void processEvents();

  /**
   * Close the connection to the host.
   */
  virtual void close();
  
  ~TcpTransport();
  
private:
  struct ndn_TcpTransport transport_;
  Node *node_;
  // TODO: This belongs in the socket listener.
  ndn_BinaryXmlElementReader elementReader_;
};

}

#endif
