14 lines
456 B
Python
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)
|