ntp-client-0.0.1
Safe HaskellNone
LanguageHaskell2010

Network.NTP.Client.Packet

Synopsis

Documentation

data NtpPacket Source #

Constructors

NtpPacket 

Fields

Instances

Instances details
Eq NtpPacket Source # 
Instance details

Defined in Network.NTP.Client.Packet

Show NtpPacket Source # 
Instance details

Defined in Network.NTP.Client.Packet

Binary NtpPacket Source # 
Instance details

Defined in Network.NTP.Client.Packet

ntpPacketSizeInt Source #

We only need first 48 bytes of a packet: reference: https://tools.ietf.org/html/rfc5905#section-7.3

mkNtpPacketIO NtpPacket Source #

Smart constructor for NtpPacket.

newtype NtpOffset Source #

NtpOffset is the difference between NTP time and local time.

Constructors

NtpOffset 

Instances

Instances details
Enum NtpOffset Source # 
Instance details

Defined in Network.NTP.Client.Packet

Eq NtpOffset Source # 
Instance details

Defined in Network.NTP.Client.Packet

Integral NtpOffset Source # 
Instance details

Defined in Network.NTP.Client.Packet

Num NtpOffset Source # 
Instance details

Defined in Network.NTP.Client.Packet

Ord NtpOffset Source # 
Instance details

Defined in Network.NTP.Client.Packet

Real NtpOffset Source # 
Instance details

Defined in Network.NTP.Client.Packet

Show NtpOffset Source # 
Instance details

Defined in Network.NTP.Client.Packet

getCurrentTimeIO Microsecond Source #

Helper function to get current time in Microsecond.

clockOffset Source #

Arguments

Microsecond

ntpResponseTimeout, ignore responses which come after it passed.

NtpPacket 
IO (Maybe NtpOffset) 

Compute clock offset unless the NTP packet was requested more than the given timeout.

realMcsToNtpMicrosecond → (Word32, Word32) Source #

It is a partial function, since Microsecond ~ Integer; it is well defined for: x < 2085978496 = (maxBound Word32 * 1000000) - ntpTimestampDelta + 1` @ (in microseconds; this is roughly 66 years, so we're fine untill 2036).

ntpToRealMcsWord32Word32Microsecond Source #

For pairs (x, y) :: (Word32, Word32) with y `mod` 4294 == 0 it is be right inverse of realMsgToNtp. In general it is not injective (for that we'd need to use Picosecond instead of Microsecond).

newtype Microsecond Source #

Constructors

Microsecond Integer 

Instances

Instances details
Enum Microsecond Source # 
Instance details

Defined in Network.NTP.Client.Packet

Eq Microsecond Source # 
Instance details

Defined in Network.NTP.Client.Packet

Integral Microsecond Source # 
Instance details

Defined in Network.NTP.Client.Packet

Num Microsecond Source # 
Instance details

Defined in Network.NTP.Client.Packet

Ord Microsecond Source # 
Instance details

Defined in Network.NTP.Client.Packet

Real Microsecond Source # 
Instance details

Defined in Network.NTP.Client.Packet

Show Microsecond Source # 
Instance details

Defined in Network.NTP.Client.Packet