_timeserver, $this->_port, $errno, $errstr, Zend_TimeSync::$options['timeout']); if ($socket === false) { throw new Zend_TimeSync_Exception('could not connect to ' . "'$this->_timeserver' on port '$this->_port', reason: '$errstr'"); } $this->_socket = $socket; } /** * Disconnects from the peer, closes the socket. * * @return void */ protected function _disconnect() { @fclose($this->_socket); $this->_socket = null; } /** * Return information sent/returned from the timeserver * * @return array */ public function getInfo() { if (empty($this->_info) === true) { $this->_write($this->_prepare()); $timestamp = $this->_extract($this->_read()); } return $this->_info; } /** * Query this timeserver without using the fallback mechanism * * @param string|Zend_Locale $locale (Optional) Locale * @return Zend_Date */ public function getDate($locale = null) { $this->_write($this->_prepare()); $timestamp = $this->_extract($this->_read()); $date = new Zend_Date($this, null, $locale); return $date; } }