Reconnect on socket issues if using http

This commit is contained in:
Daniil Gentili 2018-03-01 23:39:15 +00:00
parent 02ca94c04f
commit e82f6fd0ba
2 changed files with 2 additions and 1 deletions

View File

@ -247,7 +247,7 @@ class Connection
public function read($length)
{
\danog\MadelineProto\Logger::log(["Asked to read $length"], \danog\MadelineProto\Logger::ULTRA_VERBOSE);
//\danog\MadelineProto\Logger::log(["Asked to read $length"], \danog\MadelineProto\Logger::ULTRA_VERBOSE);
switch ($this->protocol) {
case 'obfuscated2':
$packet = '';

View File

@ -185,6 +185,7 @@ trait CallHandler
} catch (\danog\MadelineProto\NothingInTheSocketException $e) {
$last_error = 'Nothing in the socket';
\danog\MadelineProto\Logger::log(['An error getting response of method '.$method.': '.$e->getMessage().' in '.basename($e->getFile(), '.php').' on line '.$e->getLine().'. Retrying...'], \danog\MadelineProto\Logger::WARNING);
if ($this->is_http($aargs['datacenter'])) $this->close_and_reopen($aargs['datacenter']);
continue; //2;
}
}