Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2006

Tip: Looking for answers? Try searching our database.

chat room for MHP

Thread view: 
fra - 21 Mar 2006 16:14 GMT
hi! I'm a university student and I try to create a chat room for
digital television using JAVA with Multimedia home platform (MHP), but
i don't know how make a return channel connection....can you help me?

i've just create a game application for mhp with xletview, so I have
just used Xlet.

thanks!
Oliver Wong - 21 Mar 2006 17:07 GMT
> hi! I'm a university student and I try to create a chat room for
> digital television using JAVA with Multimedia home platform (MHP), but
> i don't know how make a return channel connection....can you help me?
>
> i've just create a game application for mhp with xletview, so I have
> just used Xlet.

   Use the RCInterfaceManager, which is a singleton, to get access to the
available interfaces, then check that whether the interface is an RC
connection (and thus needs a session manager) or if it's a permanent
connection.

   Here's a template code that I found online:

<code>
// First, we get a reference to the RCInterfaceManager
RCInterfaceManager rcm =
 RCInterfaceManager.getInstance();

// Now, we get the list of return channel interfaces that
// are available to our application.  This returns all
// the available interfaces
RCInterface[] interfaces = rcm.getInterfaces();

// Now choose which interface we use.

// Since we get all the interfaces, we need to check that
// we get the right type.  So, we check if the first
// interface is a ConnectionRCInterface
if (interfaces[0] instanceof ConnectionRCInterface) {

 // If it's a ConnectionRCInterface, it's not
 // permanently connected, so we need to connect it
 // first

 ConnectionRCInterface myInterface;
 myInterface = (ConnectionRCInterface)interfaces[0];
 // Now that we've got a reference to the interface, we
 // can start to use it
 try {
   // First,we reserve the connection
   myInterface.reserve();

   // Set up the connection parameters
   ConnectionParameters myConnectionParameters;
   myConnectionParameters = new ConnectionParameters
     ("0199604235697", "username", "password");

   // Then we set the target to point to our phone
   // number
   myInterface.setTarget(myConnectionParameters);

   // Now that we've done that, we can actually connect
   myInterface.connect();

   // do whatever we want to now that we've got a
   // connection

   // Once we're done, we disconnect the interface and
   // release the resource
   myInterface.disconnect();
   myInterface.release();

 } catch (permissionDeniedException e) {

   // we can't reserve the interface, so return
   return;
 }
}
else {
 // we have a permanent connection, so just use it
}
</code>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.