#include <tcp-factory.hpp>
Classes | |
struct | Error |
Exception of TcpFactory. More... | |
Public Member Functions | |
TcpFactory (const std::string &defaultPort="6363") | |
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, const FaceCreatedCallback &onCreated, const FaceConnectFailedCallback &onConnectFailed) 1 |
Try to create Face using the supplied FaceUri. More... | |
virtual std::list< shared_ptr< const Channel > > | getChannels () const |
Definition at line 35 of file tcp-factory.hpp.
|
explicit |
Definition at line 41 of file tcp-factory.cpp.
References nfd::ALL_V4_ENDPOINT(), nfd::ALL_V6_ENDPOINT(), nfd::listNetworkInterfaces(), and NFD_LOG_TRACE.
Referenced by nfd::TcpFactory::Error::Error().
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.
TcpFactory::Error |
Definition at line 96 of file tcp-factory.cpp.
References NFD_LOG_DEBUG.
Referenced by createChannel(), and nfd::TcpFactory::Error::Error().
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.
TcpFactory::Error | or std::runtime_error |
Definition at line 111 of file tcp-factory.cpp.
References createChannel().
|
virtual |
Try to create Face using the supplied FaceUri.
This method should automatically choose channel, based on supplied FaceUri and create face.
Error | Factory does not support connect operation |
Error | specified persistency is not supported |
Implements nfd::ProtocolFactory.
Definition at line 129 of file tcp-factory.cpp.
References ndn::nfd::FACE_PERSISTENCY_PERSISTENT, ndn::util::FaceUri::getHost(), ndn::util::FaceUri::getPort(), and ndn::util::FaceUri::isCanonical().
Referenced by nfd::TcpFactory::Error::Error().
|
virtual |
Implements nfd::ProtocolFactory.
Definition at line 166 of file tcp-factory.cpp.
Referenced by nfd::TcpFactory::Error::Error().