Exemple #1
0
 /**
  * @param Core_Helper_Net_Tcp $tcp
  * @param int $timeoutsec
  * @return string
  */
 public static function readHeader($tcp, $timeoutsec = 2)
 {
     $header = '';
     do {
         $line = $tcp->fgets(self::MAX_LINE_SIZE, $timeoutsec);
         $header .= $line;
         if ($line == "\r\n") {
             break;
         }
         if ($tcp->getErrno() != 0) {
             break;
         }
     } while (!$tcp->feof());
     return $header;
 }
Exemple #2
0
 public function __destruct()
 {
     $this->tcp->close();
 }