SNTP Protocol handling class

category Zend
package Zend_TimeSync
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_TimeSync_Protocol

 Methods

Class constructor, sets the timeserver and port number

__construct(string $timeserver, integer $port) 

Parameters

$timeserver

string

Timeserver to connect to

$port

integer

Port of the timeserver when it differs from the default port

Query this timeserver without using the fallback mechanism

getDate(string|\Zend_Locale $locale = null) : \Zend_Date
Inherited

Parameters

$locale

string\Zend_Locale

(Optional) Locale

Returns

\Zend_Date

Return information sent/returned from the timeserver

getInfo() : array
Inherited

Returns

array

Connect to the specified timeserver.

_connect() : void
Inherited

Exceptions

\Zend_TimeSync_Exception When the connection failed

Disconnects from the peer, closes the socket.

_disconnect() : void
Inherited

Extracts the data returned from the timeserver

_extract(string $result) : integer
inherited_from \Zend_TimeSync_Protocol::_extract()

Parameters

$result

string

Data to extract

Returns

integer

Abstract method that extracts the binary data returned from the timeserver

_extract(string|array $data) : integer
Inherited

Parameters

$data

stringarray

Data returned from the timeserver

Returns

integer

Prepares the data that will be send to the timeserver

_prepare() : array
inherited_from \Zend_TimeSync_Protocol::_prepare()

Returns

array

Abstract method that prepares the data to send to the timeserver

_prepare() : mixed
Inherited

Returns

mixed

Reads the data returned from the timeserver

_read() : string
inherited_from \Zend_TimeSync_Protocol::_read()

Returns

string

Abstract method that reads the data returned from the timeserver

_read() : mixed
Inherited

Returns

mixed

Writes data to to the timeserver

_write(string $data) : void
inherited_from \Zend_TimeSync_Protocol::_write()

Parameters

$data

string

Data to write to the timeserver

Abstract method that writes data to to the timeserver

_write(string $data) : void
Inherited

Parameters

$data

string

Data to write

 Properties

 

Exceptions that might have occured

$_exceptions : array

Default

 

Holds information passed/returned from timeserver

$_info : array

Default

array()
 

Port number for this timeserver

$_port : integer

Default

37
 

Holds the current socket connection

$_socket : array

Default

 

Hostname for timeserver

$_timeserver : string

Default

 

Socket delay

$_delay : integer

Default