Author Topic: Handling TServer responses in Java  (Read 1258 times)

Offline victor

  • Administrator
  • Hero Member
  • *****
  • Posts: 1230
  • Karma: 12
Handling TServer responses in Java
« on: April 26, 2007, 06:03:46 PM »
Hi,

I am very curious about how to handle TServer responses in Java.

I have noticed that each command gets a reply right away.
Is it the correct way to program?
I am concerned that by waiting for response significantly slows down the system.



   Message request =
    RequestRegisterAddress.create(
      "2700",                                       //DN
      RegisterMode.ModeShare,
      ControlMode.RegisterDefault,
      AddressType.DN
      );
               
   Message response = protocol.request(request);

   if(response.messageId() != EventRegistered.ID)
   {
    throw new Exception("Unexpected response to RequestRegisterAddress");
   }



I am thinking about building a proxy for TServer, thus the need to issue more than one request regardless of whether or not we got a reply. Can this be done with Java? Or do I need to open a new connection for each new DN??? This would really be worst possible thing to do.

Isn't there a way to implement some sort of callback function instead? Like we used to have in ActiveX version?

Thanks,
Vic




s.kulku

  • Guest
Re: Handling TServer responses in Java
« Reply #1 on: May 02, 2007, 07:44:04 PM »
Vic,
please tell me if you figure it out!

Sanja Kulku
Technical Product Manager