kademlia/server.tac
2014-01-13 19:49:16 -05:00

14 lines
456 B
Python

from twisted.application import service, internet
from twisted.python.log import ILogObserver
import sys, os
sys.path.append(os.path.dirname(__file__))
from kademlia.network import Server
from kademlia import log
application = service.Application("kademlia")
application.setComponent(ILogObserver, log.FileLogObserver(sys.stdout, log.INFO).emit)
kserver = Server()
server = internet.UDPServer(1234, kserver.protocol)
server.setServiceParent(application)