Added: Configurable timeouts for IMAP, SMTP and SIEVE (#843)

This commit is contained in:
RainLoop Team 2015-10-07 21:01:55 +03:00
parent c6f098bd2d
commit 55e3bad890
7 changed files with 17 additions and 3 deletions

View file

@ -76,6 +76,11 @@ class Config
*/
public static $BoundaryPrefix = '_Part_';
/**
* @var int
*/
public static $ImapTimeout = 300;
/**
* @var \MailSo\Log\Logger|null
*/

View file

@ -35,7 +35,7 @@ class MailClient
$this->oLogger = null;
$this->oImapClient = \MailSo\Imap\ImapClient::NewInstance();
$this->oImapClient->SetTimeOuts(10, 300); // TODO
$this->oImapClient->SetTimeOuts(10, \MailSo\Config::$ImapTimeout);
}
/**

View file

@ -165,8 +165,8 @@ abstract class NetClient
*/
public function SetTimeOuts($iConnectTimeOut = 10, $iSocketTimeOut = 10)
{
$this->iConnectTimeOut = $iConnectTimeOut;
$this->iSocketTimeOut = $iSocketTimeOut;
$this->iConnectTimeOut = 5 < $iConnectTimeOut ? $iConnectTimeOut : 5;
$this->iSocketTimeOut = 5 < $iSocketTimeOut ? $iSocketTimeOut : 5;
}
/**