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

  uses('peer.Socket');
  
  define('TCP_NODELAY',   1);

  /**
   * BSDSocket implementation
   *
   * @purpose  Provide an interface to the BSD sockets                    
   * @see      php://sockets                                              
   * @see      http://www.developerweb.net/sock-faq/ The UNIX Socket FAQ  
   * @ext      sockets                                                    
   */
  class BSDSocket extends Socket {
    public
      $_eof     = FALSE,
      $domain   = AF_INET,
      $type     = SOCK_STREAM,
      $protocol = SOL_TCP,
      $options  = array();

    /**
     * Set Domain
     *
     * @param   int domain one of AF_INET or AF_UNIX
     * @throws  lang.IllegalStateException if socket is already connected
     */
    public function setDomain($domain) {
      if ($this->isConnected()) {
        throw(new IllegalStateException('Cannot set domain on connected socket'));
      }
      $this->domain= $domain;
    }<commit_msg>- Work around TCP_NODELAY already being defined # Ugly...<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$
 */

  uses('peer.Socket');
  
  /**
   * BSDSocket implementation
   *
   * @purpose  Provide an interface to the BSD sockets                    
   * @see      php://sockets                                              
   * @see      http://www.developerweb.net/sock-faq/ The UNIX Socket FAQ  
   * @ext      sockets                                                    
   */
  class BSDSocket extends Socket {
    public
      $_eof     = FALSE,
      $domain   = AF_INET,
      $type     = SOCK_STREAM,
      $protocol = SOL_TCP,
      $options  = array();
    
    static function __static() {
      defined('TCP_NODELAY') || define('TCP_NODELAY', 1);
    }

    /**
     * Set Domain
     *
     * @param   int domain one of AF_INET or AF_UNIX
     * @throws  lang.IllegalStateException if socket is already connected
     */
    public function setDomain($domain) {
      if ($this->isConnected()) {
        throw(new IllegalStateException('Cannot set domain on connected socket'));
      }
      $this->domain= $domain;
    }
{'fraction_non_alphanumeric': 0.1044776119402985, 'fraction_numerical': 0.0009045680687471732, 'mean_word_length': 1.578088578088578, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '226631', 'n_tokens_mistral': 638, 'n_tokens_neox': 609, 'n_words': 169}