]> git.mxchange.org Git - hub.git/blob - ship-simu/application/hub/exceptions/socket/peer/class_BrokenPipeException.php
bdcd9634006f70803fb8bee4c13192bcbc740e03
[hub.git] / ship-simu / application / hub / exceptions / socket / peer / class_BrokenPipeException.php
1 <?php
2 // An exception for client sockets
3 class BrokenPipeException extends SocketException {
4         /**
5          * The constructor
6          *
7          * @param               $message                Message from the exception
8          * @param               $code           Code number for the exception
9          * @return      void
10          */
11         public final function __construct ($msgArray, $code) {
12                 // Construct the message
13                 $message = sprintf("[%s:%d] Connection lost to peer <u>%s</u>. Error message: <u>%s</u> (Code: %d)<br />\n", 
14                         $msgArray['this']->__toString(),
15                         $this->getLine(),
16                         $msgArray['this']->getValidatedIP(),
17                         socket_strerror($msgArray['code']),
18                         $msgArray['code']
19                 );
20
21                 // Call parent constructor
22                 parent::__construct($message, $code);
23         }
24 }
25
26 // [EOF]
27 ?>