Changeset - 6b45e0e418ee
backends/frotz/main.cpp
Show inline comments
 
@@ -153,13 +153,13 @@ class FrotzNetworkPlugin : public NetworkPlugin {
 

	
 
		FrotzNetworkPlugin(Config *config, Swift::SimpleEventLoop *loop, const std::string &host, int port) : NetworkPlugin() {
 
			this->config = config;
 
			m_factories = new Swift::BoostNetworkFactories(loop);
 
			m_conn = m_factories->getConnectionFactory()->createConnection();
 
			m_conn->onDataRead.connect(boost::bind(&FrotzNetworkPlugin::_handleDataRead, this, _1));
 
			m_conn->connect(Swift::HostAddressPort(Swift::HostAddress(host), port));
 
			m_conn->connect(Swift::HostAddressPort(SWIFT_HOSTADDRESS(host), port));
 
// 			m_conn->onConnectFinished.connect(boost::bind(&FrotzNetworkPlugin::_handleConnected, this, _1));
 
// 			m_conn->onDisconnected.connect(boost::bind(&FrotzNetworkPlugin::handleDisconnected, this));
 
		}
 

	
 
		void sendData(const std::string &string) {
 
			m_conn->write(Swift::createSafeByteArray(string));
backends/smstools3/main.cpp
Show inline comments
 
@@ -54,13 +54,13 @@ class SMSNetworkPlugin : public NetworkPlugin {
 
		SMSNetworkPlugin(Config *config, Swift::SimpleEventLoop *loop, StorageBackend *storagebackend, const std::string &host, int port) : NetworkPlugin() {
 
			this->config = config;
 
			this->storageBackend = storagebackend;
 
			m_factories = new Swift::BoostNetworkFactories(loop);
 
			m_conn = m_factories->getConnectionFactory()->createConnection();
 
			m_conn->onDataRead.connect(boost::bind(&SMSNetworkPlugin::_handleDataRead, this, _1));
 
			m_conn->connect(Swift::HostAddressPort(Swift::HostAddress(host), port));
 
			m_conn->connect(Swift::HostAddressPort(SWIFT_HOSTADDRESS(host), port));
 
// 			m_conn->onConnectFinished.connect(boost::bind(&FrotzNetworkPlugin::_handleConnected, this, _1));
 
// 			m_conn->onDisconnected.connect(boost::bind(&FrotzNetworkPlugin::handleDisconnected, this));
 

	
 
			LOG4CXX_INFO(logger, "Starting the plugin.");
 

	
 
			m_timer = m_factories->getTimerFactory()->createTimer(5000);
backends/swiften/main.cpp
Show inline comments
 
@@ -86,13 +86,13 @@ class SwiftenPlugin : public NetworkPlugin, Swift::XMPPParserClient {
 
		SwiftenPlugin(Config *config, Swift::SimpleEventLoop *loop, const std::string &host, int port) : NetworkPlugin() {
 
			this->config = config;
 
			m_firstPing = true;
 
			m_factories = new Swift::BoostNetworkFactories(loop);
 
			m_conn = m_factories->getConnectionFactory()->createConnection();
 
			m_conn->onDataRead.connect(boost::bind(&SwiftenPlugin::_handleDataRead, this, _1));
 
			m_conn->connect(Swift::HostAddressPort(Swift::HostAddress(host), port));
 
			m_conn->connect(Swift::HostAddressPort(SWIFT_HOSTADDRESS(host), port));
 
#if HAVE_SWIFTEN_3
 
			serializer = new Swift::XMPPSerializer(&collection, Swift::ClientStreamType, false);
 
#else
 
			serializer = new Swift::XMPPSerializer(&collection, Swift::ClientStreamType);
 
#endif
 
			m_xmppParser = new Swift::XMPPParser(this, &m_collection2, m_factories->getXMLParserFactory());
backends/template/plugin.cpp
Show inline comments
 
@@ -17,13 +17,13 @@ DEFINE_LOGGER(logger, "Backend Template");
 

	
 
Plugin::Plugin(Config *config, Swift::SimpleEventLoop *loop, const std::string &host, int port) : NetworkPlugin() {
 
	this->config = config;
 
	m_factories = new Swift::BoostNetworkFactories(loop);
 
	m_conn = m_factories->getConnectionFactory()->createConnection();
 
	m_conn->onDataRead.connect(boost::bind(&Plugin::_handleDataRead, this, _1));
 
	m_conn->connect(Swift::HostAddressPort(Swift::HostAddress(host), port));
 
	m_conn->connect(Swift::HostAddressPort(SWIFT_HOSTADDRESS(host), port));
 

	
 
	LOG4CXX_INFO(logger, "Starting the plugin.");
 
}
 

	
 
// NetworkPlugin uses this method to send the data to networkplugin server
 
void Plugin::sendData(const std::string &string) {
backends/twitter/TwitterPlugin.cpp
Show inline comments
 
@@ -69,13 +69,13 @@ TwitterPlugin::TwitterPlugin(Config *config, Swift::SimpleEventLoop *loop, Stora
 
	OAUTH_SECRET = "twitter_oauth_secret";
 
	MODE = "mode";
 

	
 
	m_factories = new Swift::BoostNetworkFactories(loop);
 
	m_conn = m_factories->getConnectionFactory()->createConnection();
 
	m_conn->onDataRead.connect(boost::bind(&TwitterPlugin::_handleDataRead, this, _1));
 
	m_conn->connect(Swift::HostAddressPort(Swift::HostAddress(host), port));
 
	m_conn->connect(Swift::HostAddressPort(SWIFT_HOSTADDRESS(host), port));
 

	
 
	tp = new ThreadPool(loop_, 10);
 

	
 
	LOG4CXX_INFO(logger, "Fetch timeout is set to " << CONFIG_INT_DEFAULTED(config, "twitter.fetch_timeout", 90000));
 
	tweet_timer = m_factories->getTimerFactory()->createTimer(CONFIG_INT_DEFAULTED(config, "twitter.fetch_timeout", 90000));
 
	message_timer = m_factories->getTimerFactory()->createTimer(CONFIG_INT_DEFAULTED(config, "twitter.fetch_timeout", 90000));
include/Swiften/FileTransfer/CombinedOutgoingFileTransferManager.cpp
Show inline comments
 
@@ -3,25 +3,25 @@
 
 * Licensed under the simplified BSD license.
 
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 
 */
 

	
 
#include "CombinedOutgoingFileTransferManager.h"
 

	
 
#include <boost/foreach.hpp>
 
#include <boost/smart_ptr/make_shared.hpp>
 

	
 
#include <Swiften/JID/JID.h>
 
#include "Swiften/Disco/EntityCapsProvider.h"
 
#include <Swiften/Jingle/JingleSessionManager.h>
 
#include <Swiften/Jingle/JingleSessionImpl.h>
 
#include <Swiften/Jingle/JingleContentID.h>
 
#include <Swiften/FileTransfer/OutgoingJingleFileTransfer.h>
 
#include <Swiften/FileTransfer/MyOutgoingSIFileTransfer.h>
 
#include <Swiften/FileTransfer/SOCKS5BytestreamServer.h>
 
#include <Swiften/Base/IDGenerator.h>
 
#include <Swiften/Elements/Presence.h>
 
#include <Swiften/Base/foreach.h>
 

	
 

	
 
namespace Swift {
 

	
 
CombinedOutgoingFileTransferManager::CombinedOutgoingFileTransferManager(JingleSessionManager* jingleSessionManager, IQRouter* router, EntityCapsProvider* capsProvider, RemoteJingleTransportCandidateSelectorFactory* remoteFactory, LocalJingleTransportCandidateGeneratorFactory* localFactory, SOCKS5BytestreamRegistry* bytestreamRegistry, SOCKS5BytestreamProxy* bytestreamProxy, Transport::PresenceOracle *presOracle, SOCKS5BytestreamServer *bytestreamServer) : jsManager(jingleSessionManager), iqRouter(router), capsProvider(capsProvider), remoteFactory(remoteFactory), localFactory(localFactory), bytestreamRegistry(bytestreamRegistry), bytestreamProxy(bytestreamProxy), presenceOracle(presOracle), bytestreamServer(bytestreamServer) {
 
	idGenerator = new IDGenerator();
 
@@ -65,13 +65,13 @@ boost::optional<JID> CombinedOutgoingFileTransferManager::highestPriorityJIDSupp
 
	int priority = INT_MIN;
 
	
 
	//getAllPresence(bareJID) gives you all presences for the bare JID (i.e. all resources) Remko Tronçon @ 11:11
 
	std::vector<Presence::ref> presences = presenceOracle->getAllPresence(bareJID);
 

	
 
	//iterate over them
 
	foreach(Presence::ref pres, presences) {
 
	BOOST_FOREACH(Presence::ref pres, presences) {
 
		if (pres->getPriority() > priority) {
 
			// look up caps from the jid
 
			DiscoInfo::ref info = capsProvider->getCaps(pres->getFrom());
 
			if (info && info->hasFeature(DiscoInfo::JingleFeature) && info->hasFeature(DiscoInfo::JingleFTFeature) &&
 
				info->hasFeature(DiscoInfo::JingleTransportsIBBFeature)) {
 
			
 
@@ -89,13 +89,13 @@ boost::optional<JID> CombinedOutgoingFileTransferManager::highestPriorityJIDSupp
 
	int priority = INT_MIN;
 
	
 
	//getAllPresence(bareJID) gives you all presences for the bare JID (i.e. all resources) Remko Tronçon @ 11:11
 
	std::vector<Presence::ref> presences = presenceOracle->getAllPresence(bareJID);
 

	
 
	//iterate over them
 
	foreach(Presence::ref pres, presences) {
 
	BOOST_FOREACH(Presence::ref pres, presences) {
 
		if (pres->getPriority() > priority) {
 
			// look up caps from the jid
 
			DiscoInfo::ref info = capsProvider->getCaps(pres->getFrom());
 
			if (info && info->hasFeature("http://jabber.org/protocol/si/profile/file-transfer")) {
 
			
 
				priority = pres->getPriority();
include/Swiften/Parser/PayloadParsers/GatewayPayloadParser.cpp
Show inline comments
 
@@ -3,24 +3,24 @@
 
 * Licensed under the Simplified BSD license.
 
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 
 */
 

	
 
#include <Swiften/Parser/PayloadParsers/GatewayPayloadParser.h>
 

	
 
#include <boost/foreach.hpp>
 
#include <boost/lexical_cast.hpp>
 

	
 
#include <Swiften/Parser/PayloadParserFactoryCollection.h>
 
#include <Swiften/Parser/PayloadParserFactory.h>
 
#include <Swiften/Base/foreach.h>
 
#include <Swiften/Elements/MUCOccupant.h>
 
#include <Swiften/Parser/Tree/TreeReparser.h>
 

	
 
namespace Swift {
 

	
 
void GatewayPayloadParser::handleTree(ParserElement::ref root) {
 
	foreach (ParserElement::ref child, root->getAllChildren()) {
 
	BOOST_FOREACH (ParserElement::ref child, root->getAllChildren()) {
 
		if (child->getName() == "desc") {
 
			getPayloadInternal()->setDesc(child->getText());
 
		}
 
		else if (child->getName() == "prompt") {
 
			getPayloadInternal()->setPrompt(child->getText());
 
		}
include/Swiften/Parser/PayloadParsers/MUCPayloadParser.cpp
Show inline comments
 
@@ -3,24 +3,24 @@
 
 * Licensed under the GNU General Public License v3.
 
 * See Documentation/Licenses/GPLv3.txt for more information.
 
 */
 

	
 
#include <Swiften/Parser/PayloadParsers/MUCPayloadParser.h>
 

	
 
#include <boost/foreach.hpp>
 
#include <boost/lexical_cast.hpp>
 

	
 
#include <Swiften/Parser/PayloadParserFactoryCollection.h>
 
#include <Swiften/Parser/PayloadParserFactory.h>
 
#include <Swiften/Base/foreach.h>
 
#include <Swiften/Elements/MUCOccupant.h>
 
#include <Swiften/Parser/Tree/TreeReparser.h>
 

	
 
namespace Swift {
 

	
 
void MUCPayloadParser::handleTree(ParserElement::ref root) {
 
	foreach (ParserElement::ref child, root->getAllChildren()) {
 
	BOOST_FOREACH (ParserElement::ref child, root->getAllChildren()) {
 
		if (child->getName() == "password" && child->getNamespace() == root->getNamespace()) {
 
			getPayloadInternal()->setPassword(child->getText());
 
		}
 
	}
 
}
 

	
include/Swiften/Parser/StringTreeParser.cpp
Show inline comments
 
@@ -5,12 +5,13 @@
 
 */
 

	
 
#include <Swiften/Parser/StringTreeParser.h>
 
#include <Swiften/Parser/PlatformXMLParserFactory.h>
 
#include <Swiften/Parser/Tree/ParserElement.h>
 
#include <Swiften/Parser/XMLParser.h>
 
#include <Swiften/Version.h>
 

	
 
namespace Swift {
 

	
 
class DefaultStringTreeParser : public StringTreeParser {
 
	public:
 
		void handleTree(ParserElement::ref root) {
 
@@ -25,15 +26,21 @@ class DefaultStringTreeParser : public StringTreeParser {
 
		ParserElement::ref root_;
 
};
 
	
 
ParserElement::ref StringTreeParser::parse(const std::string &xml) {
 
	PlatformXMLParserFactory factory;
 
	DefaultStringTreeParser client;
 
#if (SWIFTEN_VERSION >= 0x040000)
 
	std::unique_ptr<XMLParser> parser = factory.createXMLParser(&client);
 
#else
 
	XMLParser *parser = factory.createXMLParser(&client);
 
#endif
 
	
 
	parser->parse(xml);
 
	ParserElement::ref root = client.getRoot();
 
#if (SWIFTEN_VERSION < 0x040000)
 
	delete parser;
 
#endif
 
	return root;
 
}
 

	
 
}
include/Swiften/Serializer/PayloadSerializers/GatewayPayloadSerializer.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 
 * Copyright (c) 2011 Jan Kaluza
 
 * Licensed under the Simplified BSD license.
 
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 
 */
 

	
 
#include <Swiften/Serializer/PayloadSerializers/GatewayPayloadSerializer.h>
 
#include <Swiften/Base/foreach.h>
 
#include <Swiften/Serializer/XML/XMLRawTextNode.h>
 
#include <Swiften/Serializer/XML/XMLTextNode.h>
 
#include <Swiften/Serializer/XML/XMLElement.h>
 
#include <Swiften/Serializer/PayloadSerializerCollection.h>
 

	
 
#include "Swiften/SwiftenCompat.h"
include/Swiften/Serializer/PayloadSerializers/SpectrumErrorSerializer.cpp
Show inline comments
 
@@ -3,18 +3,16 @@
 
 * Licensed under the Simplified BSD license.
 
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 
 */
 

	
 
#include <Swiften/Serializer/PayloadSerializers/SpectrumErrorSerializer.h>
 

	
 
#include <boost/shared_ptr.hpp>
 

	
 
#include <Swiften/Base/foreach.h>
 
#include <Swiften/Serializer/XML/XMLTextNode.h>
 
#include <Swiften/Serializer/XML/XMLRawTextNode.h>
 
#include <Swiften/Serializer/XML/XMLElement.h>
 
#include "Swiften/SwiftenCompat.h"
 
#include <boost/lexical_cast.hpp>
 

	
 
namespace Swift {
 

	
 
SpectrumErrorSerializer::SpectrumErrorSerializer() : GenericPayloadSerializer<SpectrumErrorPayload>() {
 
}
include/Swiften/Serializer/PayloadSerializers/StatsSerializer.cpp
Show inline comments
 
/*
 
 * Copyright (c) 2011 Jan Kaluza
 
 * Licensed under the Simplified BSD license.
 
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 
 */
 

	
 
#include <Swiften/Serializer/PayloadSerializers/StatsSerializer.h>
 
#include <boost/foreach.hpp>
 

	
 
#include <boost/shared_ptr.hpp>
 
#include <Swiften/Serializer/PayloadSerializers/StatsSerializer.h>
 

	
 
#include <Swiften/Base/foreach.h>
 
#include <Swiften/Serializer/XML/XMLTextNode.h>
 
#include <Swiften/Serializer/XML/XMLRawTextNode.h>
 
#include <Swiften/Serializer/XML/XMLElement.h>
 

	
 
#include "Swiften/SwiftenCompat.h"
 

	
 
@@ -19,13 +18,13 @@ namespace Swift {
 

	
 
StatsSerializer::StatsSerializer() : GenericPayloadSerializer<StatsPayload>() {
 
}
 

	
 
std::string StatsSerializer::serializePayload(SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<StatsPayload> stats)  const {
 
	XMLElement queryElement("query", "http://jabber.org/protocol/stats");
 
	foreach(const StatsPayload::Item& item, stats->getItems()) {
 
	BOOST_FOREACH(const StatsPayload::Item& item, stats->getItems()) {
 
		SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<XMLElement> statElement(new XMLElement("stat"));
 
		statElement->setAttribute("name", item.getName());
 
		if (!item.getUnits().empty()) {
 
			statElement->setAttribute("units", item.getUnits());
 
		}
 
		if (!item.getValue().empty()) {
include/Swiften/Serializer/PayloadSerializers/XHTMLIMSerializer.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 
 * Copyright (c) 2011 Jan Kaluza
 
 * Licensed under the Simplified BSD license.
 
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 
 */
 

	
 
#include <Swiften/Serializer/PayloadSerializers/XHTMLIMSerializer.h>
 
#include <Swiften/Base/foreach.h>
 
#include <Swiften/Serializer/XML/XMLRawTextNode.h>
 
#include <Swiften/Serializer/XML/XMLTextNode.h>
 
#include <Swiften/Serializer/XML/XMLElement.h>
 

	
 
#include "Swiften/SwiftenCompat.h"
 

	
include/Swiften/Server/Server.cpp
Show inline comments
 
@@ -5,16 +5,16 @@
 
 */
 

	
 
#include "Swiften/Server/Server.h"
 

	
 
#include <string>
 
#include <boost/bind.hpp>
 
#include <boost/foreach.hpp>
 
#include <boost/signal.hpp>
 

	
 
#include "Swiften/Base/String.h"
 
#include "Swiften/Base/foreach.h"
 
#include "Swiften/Network/Connection.h"
 
#include "Swiften/Network/ConnectionServer.h"
 
#include "Swiften/Network/ConnectionServerFactory.h"
 
#include "Swiften/Elements/Element.h"
 
#include "Swiften/Elements/Presence.h"
 
#include "Swiften/Elements/RosterPayload.h"
 
@@ -67,13 +67,13 @@ void Server::start() {
 
		return;
 
	}
 
	if (address_ == "0.0.0.0") {
 
		serverFromClientConnectionServer = networkFactories_->getConnectionServerFactory()->createConnectionServer(port_);
 
	}
 
	else {
 
		serverFromClientConnectionServer = networkFactories_->getConnectionServerFactory()->createConnectionServer(Swift::HostAddress(address_), port_);
 
		serverFromClientConnectionServer = networkFactories_->getConnectionServerFactory()->createConnectionServer(SWIFT_HOSTADDRESS(address_), port_);
 
	}
 
	serverFromClientConnectionServerSignalConnections.push_back(
 
		serverFromClientConnectionServer->onNewConnection.connect(
 
				boost::bind(&Server::handleNewClientConnection, this, _1)));
 
// 	serverFromClientConnectionServerSignalConnections.push_back(
 
// 		serverFromClientConnectionServer->onStopped.connect(
 
@@ -93,13 +93,13 @@ void Server::stop() {
 
// 		session->finishSession();
 
// 	}
 
	serverFromClientSessions.clear();
 

	
 
	if (serverFromClientConnectionServer) {
 
		serverFromClientConnectionServer->stop();
 
		foreach(SWIFTEN_SIGNAL_NAMESPACE::connection& connection, serverFromClientConnectionServerSignalConnections) {
 
		BOOST_FOREACH(SWIFTEN_SIGNAL_NAMESPACE::connection& connection, serverFromClientConnectionServerSignalConnections) {
 
			connection.disconnect();
 
		}
 
		serverFromClientConnectionServerSignalConnections.clear();
 
		serverFromClientConnectionServer.reset();
 
	}
 

	
include/Swiften/SwiftenCompat.h
Show inline comments
 
@@ -35,10 +35,12 @@
 
 * and from boost::signals to boost::signals2 .
 
 */
 

	
 
#if (SWIFTEN_VERSION >= 0x040000)
 
#define SWIFTEN_SHRPTR_NAMESPACE std
 
#define SWIFTEN_SIGNAL_NAMESPACE boost::signals2
 
#define SWIFT_HOSTADDRESS(x) *(Swift::HostAddress::fromString(x))
 
#else
 
#define SWIFTEN_SHRPTR_NAMESPACE boost
 
#define SWIFTEN_SIGNAL_NAMESPACE boost::signals
 
#define SWIFT_HOSTADDRESS(x) Swift::HostAddress(x)
 
#endif
libtransport/Config.cpp
Show inline comments
 
@@ -70,26 +70,26 @@ bool Config::load(const std::string &configfile, boost::program_options::options
 
}
 

	
 
bool Config::load(std::istream &ifs, boost::program_options::options_description &opts, const std::string &_jid) {
 
	m_unregistered.clear();
 
	opts.add_options()
 
		("service.jid", value<std::string>()->default_value(""), "Transport Jabber ID")
 
		("service.server", value<std::string>()->default_value(""), "Server to connect to")
 
		("service.server", value<std::string>()->default_value("127.0.0.1"), "Server to connect to")
 
		("service.password", value<std::string>()->default_value(""), "Password used to auth the server")
 
		("service.port", value<int>()->default_value(0), "Port the server is listening on")
 
		("service.user", value<std::string>()->default_value(""), "The name of user Spectrum runs as.")
 
		("service.group", value<std::string>()->default_value(""), "The name of group Spectrum runs as.")
 
		("service.backend", value<std::string>()->default_value("libpurple_backend"), "Backend")
 
		("service.protocol", value<std::string>()->default_value(""), "Protocol")
 
		("service.pidfile", value<std::string>()->default_value("/var/run/spectrum2/$jid.pid"), "Full path to pid file")
 
		("service.portfile", value<std::string>()->default_value("/var/run/spectrum2/$jid.port"), "File to store backend_port to. It's used by spectrum2_manager.")
 
		("service.working_dir", value<std::string>()->default_value("/var/lib/spectrum2/$jid"), "Working dir")
 
		("service.allowed_servers", value<std::vector<std::string> >()->multitoken(), "Only users from these servers can connect")
 
		("service.server_mode", value<bool>()->default_value(false), "True if Spectrum should behave as server")
 
		("service.users_per_backend", value<int>()->default_value(100), "Number of users per one legacy network backend")
 
		("service.backend_host", value<std::string>()->default_value("localhost"), "Host to bind backend server to")
 
		("service.backend_host", value<std::string>()->default_value("127.0.0.1"), "Host to bind backend server to")
 
		("service.backend_port", value<std::string>()->default_value("0"), "Port to bind backend server to")
 
		("service.cert", value<std::string>()->default_value(""), "PKCS#12 Certificate.")
 
		("service.cert_password", value<std::string>()->default_value(""), "PKCS#12 Certificate password.")
 
		("service.admin_jid", value<std::vector<std::string> >()->multitoken(), "Administrator jid.")
 
		("service.admin_password", value<std::string>()->default_value(""), "Administrator password.")
 
		("service.reuse_old_backends", value<bool>()->default_value(true), "True if Spectrum should use old backends which were full in the past.")
libtransport/NetworkPluginServer.cpp
Show inline comments
 
@@ -303,13 +303,13 @@ NetworkPluginServer::NetworkPluginServer(Component *component, Config *config, U
 
	m_component->getFrontend()->onBuddyUpdated.connect(boost::bind(&NetworkPluginServer::handleBuddyUpdated, this, _1, _2));
 

	
 
// // 	m_blockResponder = new BlockResponder(component->getIQRouter(), userManager);
 
// // 	m_blockResponder->onBlockToggled.connect(boost::bind(&NetworkPluginServer::handleBlockToggled, this, _1));
 
// // 	m_blockResponder->start();
 

	
 
	m_server = component->getNetworkFactories()->getConnectionServerFactory()->createConnectionServer(Swift::HostAddress(CONFIG_STRING(m_config, "service.backend_host")), boost::lexical_cast<int>(CONFIG_STRING(m_config, "service.backend_port")));
 
	m_server = component->getNetworkFactories()->getConnectionServerFactory()->createConnectionServer(SWIFT_HOSTADDRESS(CONFIG_STRING_DEFAULTED(m_config, "service.backend_host", "127.0.0.1")), boost::lexical_cast<int>(CONFIG_STRING(m_config, "service.backend_port")));
 
	m_server->onNewConnection.connect(boost::bind(&NetworkPluginServer::handleNewClientConnection, this, _1));
 
}
 

	
 
NetworkPluginServer::~NetworkPluginServer() {
 
#ifndef _WIN32
 
	signal(SIGCHLD, SIG_IGN);
spectrum_manager/src/methods.cpp
Show inline comments
 
@@ -588,13 +588,13 @@ void ask_local_server(ManagerConfig *config, Swift::BoostNetworkFactories &netwo
 
				found = true;
 

	
 
				SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Connection> m_conn;
 
				m_conn = networkFactories.getConnectionFactory()->createConnection();
 
				m_conn->onDataRead.connect(boost::bind(&handleDataRead, m_conn, _1));
 
				m_conn->onConnectFinished.connect(boost::bind(&handleConnected, m_conn, message, _1));
 
				m_conn->connect(Swift::HostAddressPort(Swift::HostAddress(CONFIG_STRING(&cfg, "service.backend_host")), getPort(CONFIG_STRING(&cfg, "service.portfile"))));
 
				m_conn->connect(Swift::HostAddressPort(SWIFT_HOSTADDRESS(CONFIG_STRING_DEFAULTED(&cfg, "service.backend_host", "127.0.0.1")), getPort(CONFIG_STRING(&cfg, "service.portfile"))));
 
			}
 
		}
 

	
 
		if (!found) {
 
			response = "Error: Config file for Spectrum instance with this JID was not found\n";
 
		}
0 comments (0 inline, 0 general)