class TrackbackService: def __init__(self): self.router=None def setRouter(self, r): self.router=r; self.handler=TrackbackHandler(self.router.keys) self.trackback=ServiceHandler(self.handler) def setPutPeerForEndpointCallback(self, key, callback): self.handler.setPutPeerForEndpointCallback(key, callback) def setPutInviteForPeerCallback(self, key, callback): self.handler.setPutInviteForPeer(key, callback) def setPutTrackerInviteCallback(self, callback): self.handler.setPutTrackerInvite(callback) def handle(self, msock, msg, addr): print('Trackback message from '+encodeAddress(addr)+':') self.trackback.handleRequest(msg.decode('utf-8'))
def handle(self, msock, msg, addr): print('Tracker message from ' + encodeAddress(addr) + ': ' + msg.decode('ascii')) tracker = ServiceHandler(TrackerHandler(self.router, addr)) print('tracker: ' + str(tracker)) tracker.handleRequest(msg.decode('ascii'))
def handle(self, msock, msg, addr): print('Dustmail message from ' + encodeAddress(addr) + ': ' + msg.decode('ascii')) dustmail = ServiceHandler(DustmailHandler(self.router)) dustmail.handleRequest(msg.decode('ascii'))
def handle(self, msock, msg, addr): print('Tracker message from '+encodeAddress(addr)+':') trackback=ServiceHandler(TrackbackHandler(self.router)) trackback.handleRequest(msg.decode('utf-8'))
def handle(self, msock, msg, addr): print('Tracker message from '+encodeAddress(addr)+': '+msg.decode('ascii')) tracker=ServiceHandler(TrackerHandler(self.router, addr)) print('tracker: '+str(tracker)) tracker.handleRequest(msg.decode('ascii'))
def handle(self, msock, msg, addr): print('Tracker message from ' + encodeAddress(addr) + ':') trackback = ServiceHandler(TrackbackHandler(self.router)) trackback.handleRequest(msg.decode('utf-8'))
def handle(self, msock, msg, addr): print('Dustmail message from '+encodeAddress(addr)+': '+msg.decode('ascii')) dustmail=ServiceHandler(DustmailHandler(self.router)) dustmail.handleRequest(msg.decode('ascii'))