MCPcopy Create free account
hub / github.com/facebook/time / New

Function New

ptp/simpleclient/client.go:137–145  ·  view source on GitHub ↗

New initializes new PTPv2 unicast client

(cfg *Config, callback func(*MeasurementResult))

Source from the content-addressed store, hash-verified

135
136// New initializes new PTPv2 unicast client
137func New(cfg *Config, callback func(*MeasurementResult)) *Client {
138 c := &Client{
139 inChan: make(chan *inPacket, 10),
140 m: newMeasurements(),
141 cfg: cfg,
142 callback: callback,
143 }
144 return c
145}
146
147func (c *Client) sendGeneralMsg(p ptp.Packet) (uint16, error) {
148 seq := c.genSequence

Callers 2

TestClientRunFunction · 0.70
TestClientTimeoutFunction · 0.70

Calls 1

newMeasurementsFunction · 0.70

Tested by 2

TestClientRunFunction · 0.56
TestClientTimeoutFunction · 0.56