Refactored plugin names #4866

This commit is contained in:
Jerry (Xinyu Hou)
2015-07-24 13:17:18 -07:00
parent b105bc8f42
commit 945ccfdb75
6 changed files with 20 additions and 18 deletions

View File

@@ -21,14 +21,13 @@
#include "net/TCPSocket.h"
#include "net/TCPListenSocket.h"
#include "arch/Arch.h"
#include "common/PluginVersion.h"
#include "base/Log.h"
//
// TCPSocketFactory
//
static const char s_networkSecurity[] = { "ns" };
TCPSocketFactory::TCPSocketFactory(IEventQueue* events, SocketMultiplexer* socketMultiplexer) :
m_events(events),
m_socketMultiplexer(socketMultiplexer)
@@ -51,7 +50,7 @@ TCPSocketFactory::create(bool secure) const
m_socketMultiplexer
};
socket = static_cast<IDataSocket*>(
ARCH->plugin().invoke(s_networkSecurity, "getSocket", args));
ARCH->plugin().invoke(s_pluginNames[kSecureSocket], "getSocket", args));
}
else {
socket = new TCPSocket(m_events, m_socketMultiplexer);
@@ -70,7 +69,7 @@ TCPSocketFactory::createListen(bool secure) const
m_socketMultiplexer
};
socket = static_cast<IListenSocket*>(
ARCH->plugin().invoke(s_networkSecurity, "getListenSocket", args));
ARCH->plugin().invoke(s_pluginNames[kSecureSocket], "getListenSocket", args));
}
else {
socket = new TCPListenSocket(m_events, m_socketMultiplexer);