SNTP.time
You're seeing just the function
time
, go back to SNTP module for more information.
Specs
time(Enumerable.t()) :: {:ok, integer()} | {:error, term()}
Sends a new NTP request on an SNTP.Socket
and gracefully closes the socket.
Returns {:ok, %SNTP.Timestamp{}}
or {:error, reason}
options
anEnumerable.t()
with these keys:host
isbinary() | charlist()
defualts to'pool.ntp.org'
port
is annon_neg_integer()
between0..65535
defualts to123
timeout
is annon_neg_integer()
defualts to:infinity
resolve_reference
is aboolean()
defualts tofalse
Examples
iex> {:ok, timestamp} = SNTP.time()
iex> timestamp.is_valid?
true
iex> SNTP.time(host: 'ntp.exnet.com', port: 123, timeout: 100))
{:error, [timeout: "Server Timeout after 100"]}