MCPcopy Create free account
hub / github.com/TalkingData/owl / InitAgent

Function InitAgent

client/agent.go:41–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39)
40
41func InitAgent() error {
42 protocol := &tcp.DefaultProtocol{}
43 protocol.SetMaxPacketSize(uint32(GlobalConfig.MaxPacketSize))
44 s := tcp.NewAsyncTCPServer(GlobalConfig.TCPBind, &callback{}, protocol)
45 agent = Agent{
46 s,
47 &types.Host{},
48 &tcp.TCPConn{},
49 &tcp.TCPConn{},
50 make(chan types.TimeSeriesData, GlobalConfig.BufferSize),
51 // make(map[string]float64),
52 types.NewTimeSeriesDataStore(),
53 }
54 agent.dialCFC()
55 agent.dialRepeater()
56 agent.hostcfg = newHostConfig()
57 return agent.ListenAndServe()
58}
59
60// 连接cfc
61func (agent *Agent) dialCFC() error {

Callers 1

mainFunction · 0.85

Calls 5

newHostConfigFunction · 0.85
SetMaxPacketSizeMethod · 0.80
ListenAndServeMethod · 0.80
dialCFCMethod · 0.45
dialRepeaterMethod · 0.45

Tested by

no test coverage detected