本文整理匯總了Python中receiver.Receiver.multicast_address方法的典型用法代碼示例。如果您正苦於以下問題:Python Receiver.multicast_address方法的具體用法?Python Receiver.multicast_address怎麽用?Python Receiver.multicast_address使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類receiver.Receiver
的用法示例。
在下文中一共展示了Receiver.multicast_address方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from receiver import Receiver [as 別名]
# 或者: from receiver.Receiver import multicast_address [as 別名]
def main():
# TODO: parse configuration file to retreive
# sender's and receiver's ip addresses
config_dict = parse_config()
if not config_dict:
print 'no config params'
return
sender_name = config_dict['IP'] + '_sender'
recv_name = config_dict['IP'] + '_receiver'
print 'sender name: ' + sender_name
print 'receiver name: ' + recv_name
s_obj = Sender()
r_obj = Receiver()
s_obj.ip_address = config_dict['IP']
r_obj.ip_address = config_dict['IP']
s_obj.multicast_address = config_dict['multicast']
r_obj.multicast_address = config_dict['multicast']
Pyro4.Daemon.serveSimple(
{
s_obj: sender_name,
r_obj: recv_name
},
ns=False,
port=45000,
host=config_dict["IP"]
)