Example #1
0
	def __register_app(self):
		""" This function ask the Siderus Daemon to register the app """
		
		self.address = from_arg_to_addr(app=self.name, port=DEFAULT_APP_TMP_PORT)
		daemon_address = return_daemon_address("127.0.0.1",DAEMON_LOC_PORT)
		
		message_ask = Message(origin=self.address, destination=daemon_address)
		message_ask.content = {"intent": DAEMON_APP_LCCN_REQ}
		
		message_port = Message(destination=self.address)
		
		message_ask.send()
		message_port.receive_and_decode()
		
		self.address = message_port.content['address']		
Example #2
0
#!/usr/bin/env python

import sys
sys.path.append("..")
sys.path.append("../..")

from siderus.message import Message
from siderus.common import return_application_address, from_arg_to_addr

destination = return_application_address("MessageTester" , 52225)

m = Message(destination=destination)
m.receive_and_decode()

print(m.content)