By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,903 Members | 1,977 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,903 IT Pros & Developers. It's quick & easy.

How to get a multicast to wait for all nodes?

P: n/a
I have a code that receives gps information from nodes and gives off
its own coordinates via radios connected by Ethernet. but the code
continues to run after receiving only 1 set of coordinates, how do i
get it to wait for multiple nodes to send before continuing
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jun 27, 8:09*am, "Colin J. Williams" <c...@ncf.cawrote:
Ryuke wrote:
I have a code that receives gps information from nodes and gives off
its own coordinates via radios connected by Ethernet. *but the code
continues to run after receiving only 1 set of coordinates, how do i
get it to wait for multiple nodes to send before continuing

You might provide wth significant part
of the code you have written.

Colin W.

oops. guess that's important, here's part of it

#Get local node network view data from RIB using SNMP over Ethernet
mynodeID = snmpget(RIB_HOST, MYNODE_ID)
# print '[netge module] MYnode ID =',mynodeID
netdict = snmpwalk(RIB_HOST,MIB_BASE)
netdict[MYNODE_ID] = mynodeID
print '[netge module] MyNode ID = ',netdict[MYNODE_ID]

sorted_keys = sorted(netdict)
# for key in sorted_keys: print '%s\t\t%s' % (key,netdict[key])
for c in netdict[NODE_LIST][1:]: print '[netge module] NbrNode
%d'% ord(c)

#Create heart beat data packet for multicast xfer
# gpsdata.append(time.ctime())
print '[netge module] mynode location =
',netdict[MYNODE_LOCATION]
# netdict[MYNODE_LOCATION] = ' '.join(gpsdata)
netdict[MYNODE_LOCATION] = gpsdata
print '[netge module] mynode location =
',netdict[MYNODE_LOCATION]
heartbeat = ' '.join(netdict[MYNODE_LOCATION])
print '[netge module] heartbeat=',heartbeat

#Send mulitcast heart beat packet of local node view of
network
sock.sendto(heartbeat,(MULTICAST_IP_ADDR, MULTICAST_PORT))
print '[netge module] multicast send'

#Receive mulitcast heart beat data
#ReceiveHB()
print '[netge module] multicast receive=',sock.recv(1024)

#Create KMZ file for local node view of network
# CreateKMZfile(netdict)

node = []
latitude = []
longitude = []
altitude = []
kml_nodes = ''
kml_links = ''

MAX_NUM = int(netdict[NUMBEROFNODES])
# MAX_NUM = len(netdict[NODE_LIST])
# print MAX_NUM
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.