AfriCC/php-epp2

how to use hello Keeping sessions alive?

Closed this issue · 2 comments

how to use hello Keeping sessions alive?

https://github.com/AfriCC/php-epp2/blob/master/src/AfriCC/EPP/Frame/Hello.php

can provide the code example?

Why would you need to keep sessions alive? Usually It should be like

  1. create & connect client
  2. Issue commands and get responses
  3. close connection

If you'd like to keep sessions alive, you need to keep in mind that the longest time a connection will be kept alive is the duration of your script execution... so if you have long running loop and you need the connection to be alive, your best bet would be:

//...
$hello = new Hello();
//...
while($loong_loop){
//.. loooon loop
$client->request($hello); //will do hello every loop iteration
}
//now do your stuff

Out of scope for now. I would not keep connections alive but instead make use of a queue/worker system.