I would like to suggest a slight modification

On Tue, Dec 4, 2012 at 7:46 PM, Emmanuel Lécharny <elecharny@gmail.com> wrote:
Hi,

as a follow up for my previous mail, here is a suggestion for
replication that handles the disconnection :

LdapServer.startReplicationConsumers
  create a ping thread
  start the ping thread

differ this creation of ping thread and move it to PING
  for each consumer
    do
      init consumer
      create new replication thread
      add a ping for this consumer
not sure what does it mean by 'add a ping...' here.
The ping should rely on the state of the consumer,
say when the consumer is first created 'ping' thread need not validate this consumer's connection
however it should kick in to action after consumer successfully starts for the first time
      start it
    done


PING:
ping thread
  while not stopped
    do
      for each consumer
        do
          try to bind anonymous

          if not success
            then disconnect consumer
        done

      wait N seconds
    done


replication thread
  while not stopped
    do
      connect
      if connected
        then
          do
            status <- start replication
          while status is refresh request // Special case

      if status == stopped
        then exit loop

      if status == disconnected
        then continue
    done


Thoughts ?

--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com




--
Kiran Ayyagari
http://keydap.com