#include <tcp-factory.hpp>
Public Member Functions | |
shared_ptr< TcpChannel > | createChannel (const tcp::Endpoint &localEndpoint) |
Create TCP-based channel using tcp::Endpoint. More... | |
shared_ptr< TcpChannel > | createChannel (const std::string &localIp, const std::string &localPort) |
Create TCP-based channel using specified IP address and port number. More... | |
virtual void | createFace (const FaceUri &uri, ndn::nfd::FacePersistency persistency, bool wantLocalFieldsEnabled, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure) override |
Try to create Face using the supplied FaceUri. More... | |
virtual std::vector< shared_ptr< const Channel > > | getChannels () const override |
Definition at line 34 of file tcp-factory.hpp.
shared_ptr< TcpChannel > nfd::TcpFactory::createChannel | ( | const tcp::Endpoint & | localEndpoint | ) |
Create TCP-based channel using tcp::Endpoint.
tcp::Endpoint is really an alias for boost::asio::ip::tcp::endpoint.
If this method called twice with the same endpoint, only one channel will be created. The second call will just retrieve the existing channel.
Definition at line 77 of file tcp-factory.cpp.
References NFD_LOG_DEBUG.
Referenced by createChannel().
shared_ptr< TcpChannel > nfd::TcpFactory::createChannel | ( | const std::string & | localIp, |
const std::string & | localPort | ||
) |
Create TCP-based channel using specified IP address and port number.
This method is just a helper that converts a string representation of localIp and port to tcp::Endpoint and calls the other createChannel overload.
std::runtime_error |
Definition at line 92 of file tcp-factory.cpp.
References createChannel().
|
overridevirtual |
Try to create Face using the supplied FaceUri.
This method should automatically choose channel, based on supplied FaceUri and create face.
uri | remote URI of the new face |
persistency | persistency of the new face |
wantLocalFieldsEnabled | whether local fields should be enabled on the face |
onCreated | callback if face creation succeeds If a face with the same remote URI already exists, its persistency and LocalFieldsEnabled setting will not be modified. |
onFailure | callback if face creation fails |
Implements nfd::ProtocolFactory.
Definition at line 100 of file tcp-factory.cpp.
References ndn::nfd::FACE_PERSISTENCY_PERSISTENT, ndn::util::FaceUri::getHost(), ndn::util::FaceUri::getPort(), ndn::util::FaceUri::isCanonical(), and NFD_LOG_TRACE.
|
overridevirtual |
Implements nfd::ProtocolFactory.
Definition at line 150 of file tcp-factory.cpp.