| * See COPYING for copyright and distribution information. |
| #include "TcpTransport.hpp" |
| void TcpTransport::connect(char *host, unsigned short port) |
| if (error = ndn_TcpTransport_connect(&transport_, host, port)) |
| throw std::runtime_error(ndn_getErrorString(error)); |
| void TcpTransport::send(unsigned char *data, unsigned int dataLength) |
| if (error = ndn_TcpTransport_send(&transport_, data, dataLength)) |
| throw std::runtime_error(ndn_getErrorString(error)); |
| unsigned int TcpTransport::receive(unsigned char *buffer, unsigned int bufferLength) |
| if (error = ndn_TcpTransport_receive(&transport_, buffer, bufferLength, &nBytes)) |
| throw std::runtime_error(ndn_getErrorString(error)); |