22 #ifndef NDN_CXX_TRANSPORT_TCP_TRANSPORT_HPP
23 #define NDN_CXX_TRANSPORT_TCP_TRANSPORT_HPP
27 #include <boost/asio/ip/tcp.hpp>
33 template<
typename BaseTransport,
typename Protocol>
34 class StreamTransportImpl;
36 template<
typename BaseTransport,
typename Protocol>
37 class StreamTransportWithResolverImpl;
48 TcpTransport(
const std::string& host,
const std::string& port =
"6363");
71 static shared_ptr<TcpTransport>
72 create(
const std::string& uri);
75 static std::pair<std::string, std::string>
76 getSocketHostAndPortFromUri(
const std::string& uri);
85 shared_ptr<Impl> m_impl;
Represents a TLV element of the NDN packet format.
A transport that uses a TCP socket for communication.
TcpTransport(const std::string &host, const std::string &port="6363")
void send(const Block &wire) override
Send a TLV block through the transport.
void pause() override
Pause the transport, canceling all pending operations.
static shared_ptr< TcpTransport > create(const std::string &uri)
Create transport with parameters defined in URI.
void connect(boost::asio::io_context &ioCtx, ReceiveCallback receiveCallback) override
Asynchronously open the connection.
void close() override
Close the connection.
void resume() override
Resume the transport.
Provides a "TLV-oriented" delivery service.
std::function< void(const Block &)> ReceiveCallback
Implementation detail of a Boost.Asio-based stream-oriented transport.
Implementation detail of a Boost.Asio-based stream-oriented transport with resolver support.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE