rename to ServerEndpointService, for consistency with Twisted

This commit is contained in:
Brian Warner 2015-09-28 16:23:00 -07:00
parent 540fceb795
commit b088747ae3
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ from twisted.python import log
from twisted.internet import reactor, protocol, endpoints from twisted.internet import reactor, protocol, endpoints
from twisted.application import service, internet from twisted.application import service, internet
from twisted.web import server, static, resource, http from twisted.web import server, static, resource, http
from ..util.endpoint_service import EndpointServerService from ..util.endpoint_service import ServerEndpointService
from .. import __version__ from .. import __version__
from ..database import get_db from ..database import get_db
@ -407,7 +407,7 @@ class RelayServer(service.MultiService):
self.root = Root() self.root = Root()
site = server.Site(self.root) site = server.Site(self.root)
r = endpoints.serverFromString(reactor, relayport) r = endpoints.serverFromString(reactor, relayport)
self.relayport_service = EndpointServerService(r, site) self.relayport_service = ServerEndpointService(r, site)
self.relayport_service.setServiceParent(self) self.relayport_service.setServiceParent(self)
self.relay = Relay(self.db, welcome) # accessible from tests self.relay = Relay(self.db, welcome) # accessible from tests
self.root.putChild(b"wormhole-relay", self.relay) self.root.putChild(b"wormhole-relay", self.relay)
@ -418,5 +418,5 @@ class RelayServer(service.MultiService):
self.transit = Transit() self.transit = Transit()
self.transit.setServiceParent(self) # for the timer self.transit.setServiceParent(self) # for the timer
t = endpoints.serverFromString(reactor, transitport) t = endpoints.serverFromString(reactor, transitport)
self.transport_service = EndpointServerService(t, self.transit) self.transport_service = ServerEndpointService(t, self.transit)
self.transport_service.setServiceParent(self) self.transport_service.setServiceParent(self)

View File

@ -4,7 +4,7 @@ from twisted.application import service
# this should probably live in Twisted # this should probably live in Twisted
class EndpointServerService(service.Service): class ServerEndpointService(service.Service):
def __init__(self, endpoint, factory): def __init__(self, endpoint, factory):
self.endpoint = endpoint self.endpoint = endpoint
self.factory = factory self.factory = factory