[AG-TECH] Development issue: AllocationMulticastLocation

Brian Corrie bcorrie at sfu.ca
Fri Oct 8 19:17:46 CDT 2004


Hi Randy,

Not sure about the approach - I don't understand multicast well enough 
to say. I think there is something about group joins that are IP number 
specific and that having many ports on the same mcast group may not be 
the best idea... Not sure though.

Here is a bit of code that might help... This code was produced by one 
of the folks at NRC in Ottawa - thanks Siraj! Normal disclaimer - not 
sure how robust this is (it works for us) and it is pulled from a class 
so some of the bits may be missing. Hopefully you get the idea...

Brian

     def getVenueStreamAddress(self, streamtype, multicast, venueURL=None):
         # Use the current venue if none is specified for the
         # venue url
         if venueURL==None:
             venueURL=self.getVenueURL()

         # Grab the stream descriptions from the venue.
         stream = self.getVenueProxy(venueURL).GetStreams()

         # Iterate through the list of streams and locate
         # the video stream
         for i in range(len(stream)):
             self.log.debug("\n%s",stream[i].capability.type)
             if stream[i].capability.type==streamtype:
                 for j in range(len(stream[i].networkLocations)):
                     if (stream[i].networkLocations[j].TYPE 		 
        					=='multicast')==multicast:
                         return 
(stream[i].networkLocations[j].GetHost(), 			 
stream[i].networkLocations[j].GetPort())

         # Could not find the given address type
         # no address!
         return None

     def getVenueProxy(self, venueURL=None):
         # If no venueURL is specified assume that the current venue
         # url is to be used.
         if venueURL==None:
             venueURL=self.getVenueURL()

         # Get a handle to the venue client soap interface.
         # The proxy returned can be used to grab Venue Client info.
         self.log.info("\nGetting Venue Proxy")
         venueProxy = VenueIW(venueURL)

         # Make sure we can connect to the proxy.
         try:
             self.log.info("Connected to....%s",venueProxy.GetName())
             return venueProxy
         except:
             self.log.exception("Cannot connect to Venue...%s", venueURL)
             return None

     def getVenueURL (self):
	# sharedAppClient is an SharedAppClient class object. This
	# assumes it is running within a shared app.
         return self.sharedAppClient.GetVenueURL()


Randy Groves wrote:
> I have a similar question - although I haven't poked around in the code 
> yet.
> 
> I've got a Shared WhiteBoard app in the works.  Fairly simple - 
> essentially just a wrapper around wbd - which runs on Windows and Linux 
> (although I haven't worked on the Linux startup part yet).  Right now it 
> just hardwires a multicast address and port to do the communication.  
> What I'm thinking of doing is extracting the multicast address and port 
> of the video stream and allocating a port that isn't being used on that 
> address.  Then keeping track of that somehow, so that a second white 
> board in the same venue would get a still different port.
> 
> So, first question - is there anything basically wrong with this approach?
> 
> And second - are the hooks available and documented (pointers to code is 
> fine) that will give me the current multicast address and port of the 
> streams in a venue?
> 
> Thanks!!
> 
> -randy
> 
> At 04:23 AM 10/8/2004, Socrates Varakliotis wrote:
> 
>> Hi:
>>
>> I was looking into AccessGrid/Venue.py, around line 926. There is a 
>> method AllocateMulticastLocation() to allocate a Network Location. 
>> This code is used by the Venue Server.
>>
>> I was wondering whether I could have a handle from within this method 
>> to the Venue Management options.
>>
>> My problem is this:
>> Say I want to check whether RANDOM or INTERVAL address allocation 
>> method has been selected from Venue Management. I can do this:
>>
>> allocMethod = self.server.addressAllocationMethod
>>
>> and check with some if conditions whether allocMethod=='random' or 
>> allocMethod=='interval', + other blah blah.
>>
>> What if I need to check against other "settings" from the Venue 
>> Management, e.g.: what if I want to detect whether static address 
>> allocation has been selected, or one of the dynamic methods? Is there 
>> any attribute in the server's class to hold this information, or 
>> should I add one?
>>
>> Any ideas/help appreciated.
>>
>>
>> Best regards,
>> -- 
>> Socrates.
>>
>>
>>
>>
>> -- 
>> Dr. Socrates Varakliotis
>> UCL Computer Science
>> Gower Street, WC1E 6BT, London, UK
>> Tel: +44 20 7679 3696
>> Fax: +44 20 7387 1397
>>
> 
> 




More information about the ag-tech mailing list