MCPcopy Create free account
hub / github.com/Cyinx/einx / StartTcpClientMgr

Function StartTcpClientMgr

einx_default.go:65–79  ·  view source on GitHub ↗
(m module.Module, name string, mgr interface{}, opts ...Option)

Source from the content-addressed store, hash-verified

63}
64
65func StartTcpClientMgr(m module.Module, name string, mgr interface{}, opts ...Option) {
66 m_eventer := m.(event.EventReceiver)
67
68 opts = append(opts, NetworkOption.Name(name))
69 opts = append(opts, network.Module(m_eventer))
70 opts = append(opts, NetworkOption.ServeHandler(mgr.(SessionHandler)))
71
72 tcp_client := network.NewTcpClientMgr(opts...)
73
74 e := &event.ComponentEventMsg{}
75 e.MsgType = event.EVENT_COMPONENT_CREATE
76 e.Sender = tcp_client
77 e.Attach = mgr
78 m_eventer.PushEventMsg(e)
79}
80
81func AddModuleComponent(m module.Module, c Component, mgr interface{}) {
82 m_eventer := m.(event.EventReceiver)

Callers

nothing calls this directly

Calls 2

ServeHandlerMethod · 0.80
PushEventMsgMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…