face: Adding new 'createFace' method in all Factories
This method accepts parsed URI object and attempts to create Face on the
right channel (e.g., if hostname in URI resolved to IPv6, IPv6 TCP channel
will be used).
Factories that do not support 'createFace' operation will throw an exception.
As of this commit, *Factory::create methods are renamed to more explicit
*Factory::createChannel, and *Factory::connect to *Factory::createFace.
All other Factory-specific methods should denote what exactly is
created: channel, face, or multicast face.
Change-Id: I6396dc84c4cd8bbcdde9f55cfac90635d99e93e9
Refs: #1195
diff --git a/daemon/main.cpp b/daemon/main.cpp
index e971a35..bd511bb 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -172,8 +172,8 @@
initializeTcp()
{
g_tcpFactory = new TcpFactory();
- g_tcpChannel = g_tcpFactory->create(g_options.m_tcpListen.first,
- g_options.m_tcpListen.second);
+ g_tcpChannel = g_tcpFactory->createChannel(g_options.m_tcpListen.first,
+ g_options.m_tcpListen.second);
g_tcpChannel->listen(
bind(&onFaceEstablish, _1, static_cast<std::vector<Name>*>(0)),
&onFaceError);
@@ -191,7 +191,7 @@
initializeUnix()
{
g_unixFactory = new UnixStreamFactory();
- g_unixChannel = g_unixFactory->create(g_options.m_unixListen);
+ g_unixChannel = g_unixFactory->createChannel(g_options.m_unixListen);
g_unixChannel->listen(
bind(&onFaceEstablish, _1, static_cast<std::vector<Name>*>(0)),