'Can\'t create socket: "%s"', self::CANT_BIND_SOCKET => 'Can\'t bind socket: "%s"', self::CANT_LISTEN => 'Can\'t listen: "%s"', self::CANT_ACCEPT => 'Can\'t accept connections: "%s"', self::CANT_CONNECT => 'Can\'t connect: "%s"', self::SOCKET_ERROR => 'Socket Error: "%s"', self::SOCKET_EAGAIN => 'Socket Resource Temporarily Unavailable - Try again', self::SOCKET_TIMEOUT => 'Timeout reached "%d"', self::SOCKET_READ => 'Unable to read from socket', self::CONNECTION_RESET => 'Connection reset by peer', ]; public function __construct(int $code,string $params=NULL) { $message = $params ? call_user_func_array('sprintf',[$this->messages[$code],$params]) : $this->messages[$code]; parent::__construct($message,$code); } }