示例#1
0
def makeService(config):
    router = component.Router()
    factory = component.XMPPComponentServerFactory(router, config['secret'])

    if config['verbose']:
        factory.logTraffic = True

    return strports.service(config['port'], factory)
示例#2
0
def makeService(config):
	router = component.Router()
	factory = component.XMPPComponentServerFactory(router, config['secret'])

	if config['verbose']:
		factory.logTraffic = True

	return strports.service(config['port'], factory)
示例#3
0
文件: tap.py 项目: samis/blockBox
def makeService(config):
	credCheckers = config.get('credCheckers', [])
	wordsRealm = service.InMemoryWordsRealm(config['hostname'])
	wordsPortal = portal.Portal(wordsRealm, credCheckers)

	msvc = MultiService()

	# XXX Attribute lookup on config is kind of bad - hrm.
	for plgName in config.interfacePlugins:
		port = config.get(plgName + '-port')
		if port is not None:
			factory = config.interfacePlugins[plgName].getFactory(wordsRealm, wordsPortal)
			svc = strports.service(port, factory)
			svc.setServiceParent(msvc)

	# This is bogus.  createGroup is async.  makeService must be
	# allowed to return a Deferred or some crap.
	for g in config['groups']:
		wordsRealm.createGroup(g)

	return msvc
示例#4
0
def makeService(config):
	return strports.service(config['port'], toc.TOCFactory())
示例#5
0
def makeService(config):
    return strports.service(config['port'], toc.TOCFactory())