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

Offline victor

  • Administrator
  • Hero Member
  • *****
  • Posts: 1416
  • Karma: 18
Handling TServer responses in Java
« on: April 26, 2007, 09:03:46 AM »
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.

[size=8pt]

  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");
  }

[/size]

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, 10:44:04 AM »
Vic,
please tell me if you figure it out!

Sanja Kulku
Technical Product Manager