Exemple #1
0
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'))
Exemple #2
0
 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'))
Exemple #4
0
 def handle(self, msock, msg, addr):
   print('Tracker message from '+encodeAddress(addr)+':')
   trackback=ServiceHandler(TrackbackHandler(self.router))
   trackback.handleRequest(msg.decode('utf-8'))
Exemple #5
0
 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'))
Exemple #6
0
 def handle(self, msock, msg, addr):
     print('Tracker message from ' + encodeAddress(addr) + ':')
     trackback = ServiceHandler(TrackbackHandler(self.router))
     trackback.handleRequest(msg.decode('utf-8'))
Exemple #7
0
 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'))