How to get a multicast to wait for all nodes?

R

Ryuke

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
 
C

Colin J. Williams

Ryuke said:
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.
 
R

Ryuke

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top