forked from php-amqplib/php-amqplib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request php-amqplib#653 from ramunasd/handle_closed_connec…
…tion Handle broken pipe or closed connection exceptions
- Loading branch information
Showing
17 changed files
with
758 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
<?php | ||
namespace PhpAmqpLib\Exception; | ||
|
||
/** | ||
* When connection was closed by server, proxy or some tunnel due to timeout or network issue. | ||
*/ | ||
class AMQPConnectionClosedException extends AMQPRuntimeException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,35 @@ | ||
<?php | ||
|
||
namespace PhpAmqpLib\Exception; | ||
|
||
class AMQPTimeoutException extends \RuntimeException implements AMQPExceptionInterface | ||
{ | ||
/** | ||
* @var int|float|null | ||
*/ | ||
private $timeout; | ||
|
||
public function __construct($message = '', $timeout = 0, $code = 0, \Exception $previous = null) | ||
{ | ||
parent::__construct($message, $code, $previous); | ||
$this->timeout = $timeout; | ||
} | ||
|
||
/** | ||
* @param int|float|null $timeout | ||
* @param int $code | ||
* @return self | ||
*/ | ||
public static function writeTimeout($timeout, $code = 0) | ||
{ | ||
return new self('Error sending data. Connection timed out.', $timeout, $code); | ||
} | ||
|
||
/** | ||
* @return int|float|null | ||
*/ | ||
public function getTimeout() | ||
{ | ||
return $this->timeout; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.