User Tools

Site Tools


public:t-622-arti-07-1:bob.java
import com.cmlabs.air.JavaAIRPlug;
import com.cmlabs.air.Message;
 
public class Bob
{
   /*----------------------------------------------
   ---------     Member variables    --------------
   ----------------------------------------------*/
   private JavaAIRPlug m_obPlug = new JavaAIRPlug( "Bob", "localhost", 10000 );
 
   /*----------------------------------------------
   -----------     Constructors      --------------
   ----------------------------------------------*/
 
   /*----------------------------------------------
   ----------     Get & Set Functions    ----------
   ----------------------------------------------*/
 
   /*----------------------------------------------
   ------------      Functions       --------------
   ----------------------------------------------*/
 
   public void runModule()
   {
      postHello();
 
      while(true)
      {
         Message obMessage = m_obPlug.waitForNewMessage( 100 );
         if( obMessage != null )
         {
            if( obMessage.type.equalsIgnoreCase( "Intro.AI.Communication.Greeting.Response") )
            {
               System.out.println( "Got response" );
            }
         }
      }
   }
 
   private void postHello()
   {
      m_obPlug.postMessage( "WB1", "Intro.AI.Communication.Greeting",
                            "Hello", "English", "" );
   }
 
 
   public static void main( String[] args )
   {
      Bob obBob = new Bob();
 
      obBob.runModule();
   }
}
/var/www/cadia.ru.is/wiki/data/pages/public/t-622-arti-07-1/bob.java.txt · Last modified: 2024/04/29 13:33 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki