def subscribe(self, id, name, port):
     """Send a Subscribe request to a remote machine"""
     sub = gntp.GNTPSubscribe()
     sub.add_header('Subscriber-ID', id)
     sub.add_header('Subscriber-Name', name)
     sub.add_header('Subscriber-Port', port)
     if self.password:
         sub.set_password(self.password, self.passwordHash)
     return self._send('subscribe', sub.encode())
Exemple #2
0
	def subscribe(self,id,name,port):
		sub = gntp.GNTPSubscribe()
		sub.add_header('Subscriber-ID',id)
		sub.add_header('Subscriber-Name',name)
		sub.add_header('Subscriber-Port',port)
		if self.password:
			sub.set_password(self.password,self.passwordHash)
		response = self.send('subscribe',sub.encode())
		if isinstance(response,gntp.GNTPOK): return True
		return response.error()
Exemple #3
0
 def subscribe(self, id, name, port):
     """Send a Subscribe request to a remote machine"""
     sub = gntp.GNTPSubscribe()
     sub.add_header('Subscriber-ID', id)
     sub.add_header('Subscriber-Name', name)
     sub.add_header('Subscriber-Port', port)
     if self.password:
         sub.set_password(self.password, self.passwordHash)
     response = self._send('subscribe', sub.encode())
     if isinstance(response, gntp.GNTPOK):
         return True
     logger.error('Invalid response %s', response.error())
     return response.error()