[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] connecting



Michele Laghi schrieb:
> The method reachedAlive of your own implementation of
> I_ConnectionStateListener will be invoked (don't forget to register it)
> 
> see for example the first example in
> http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.failsafe.html

Hey thanks for your answer. I registered a I_ConnectionStateListener but
it has no effect. Then I tried the following:

//-- code --
_XmlBlasterAccess acces = glob.getXmlBlasterAccess
try{
  access.connect();
}catch(XmlBlasterException e)
{
  while (acces.isPolling())
  {
    // wait for server.
  }
}

...
//-------

Strange is that the loop doesn't loop but the log output says the client
changes from UNDEF to POLLING. Is this a feature or a bug? IMHO its a
bug. Look at isPolling:

//-- code --
public boolean isPolling() {
  if (!isConnected()) return false;
  return this.dispatchManager.getDispatchConnectionsHandler().isPolling();
   }
//-------

isConnected must return false because we got no connection, but the
client is polling for a server and tries to get a connection! IMHO
isPolling() should only call the DispatchManagers
ConnectionHandler.isPolling().