Documentation
¶
Index ¶
Constants ¶
View Source
const (
DEFAULT_PACKET_SIZE = 6 * 8 // udp报文大小
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NTPC ¶
type NTPC struct { ServerAddr string // 时间服务器地址 RequestId uint64 // 请求报文的序列号(用于校验) TimeOut time.Duration // 通信超时时间 }
type Packet ¶
type Packet struct { Version uint64 // 版本信息,目前暂未使用 RequestId uint64 // 请求编号,用于校验 T1 TimeStamp // T1 客户端发送请求的时间 T2 TimeStamp // T2 服务器接收请求的时间 T3 TimeStamp // T3 服务器答复时间 T4 TimeStamp // T4 客户端接收答复时间 }
UDP报文结构信息
type Result ¶
Click to show internal directories.
Click to hide internal directories.