• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Section E.3. Network APIs

E.3. Network APIs

This section illustrates how to use the Network APIs through a simple example that enables and disables channels. Here the MPEGlet Net_Example obtains a handle to the NetworkManager through the MpegjTerminal. Using the NetworkManager object, the MPEGlet obtains the ChannelController object. The MPEGlet uses the ChannelController to enable and disable a channel.

import org.iso.mpeg.mpegj.resourceManager.*;
import org.iso.mpeg.mpegj.scene.*;
import org.iso.mpeg.mpegj.*;
import org.iso.mpeg.mpegj.net.*;

public class Net_Example implements MPEGlet{
   MpegjTerminal mpegjTerminal;
   private NetworkManager netManager;
   ChannelController cc;
   public void Net_Example() {
   }
   public void init(){
      mpegjTerminal = new MpegjTerminal(MPEGlet);
      try {
         netManager = mpegjTerminal.getNetworkManager();
      } catch(NetworkManagerNotFoundException ex){ }
         catch(MPEGJException ex){ }

   // to get the channel controller used to enable/ disable
   // the channels
      cc = netManager.getChannelController();

      // to enable a channel
      cc.enable( serviceSessionID, channelID);
      // to disable a channel
      cc.disable( serviceSessionID, channelID);
   }
   public void stop(){}
   public void destroy(){}
}


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint