<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$
 */

  uses('peer.SocketException');

  /**
   * Indicate a timeout occurred on a socket read
   *
   * @see      xp://peer.Socket#setTimeout
   * @see      xp://peer.SocketException
   */
  class SocketTimeoutException extends SocketException {

  }
?><commit_msg>- Add timeout parameter to constructor - Add getTimeout() accessor - Include timeout in compound message<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$
 */

  uses('peer.SocketException');

  /**
   * Indicate a timeout occurred on a socket read
   *
   * @see      xp://peer.Socket#setTimeout
   * @see      xp://peer.SocketException
   */
  class SocketTimeoutException extends SocketException {
    protected $timeout= 0.0;
    
    /**
     * Constructor
     *
     * @param   string message
     * @param   float timeout
     */
    public function __construct($message, $timeout) {
      parent::__construct($message);
      $this->timeout= $timeout;
    }

    /**
     * Get timeout
     *
     * @return  float
     */
    public function getTimeout() {
      return $this->_timeout;
    }
    
    /**
     * Return compound message of this exception.
     *
     * @return  string
     */
    public function compoundMessage() {
      return sprintf(
        'Exception %s (%s after %.3f seconds)',
        $this->getClassName(),
        $this->message,
        $this->timeout
      );
    }
  }
?>
{'fraction_non_alphanumeric': 0.12279511533242876, 'fraction_numerical': 0.0020352781546811396, 'mean_word_length': 2.172043010752688, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6072839', 'n_tokens_mistral': 434, 'n_tokens_neox': 421, 'n_words': 115}