MCPcopy
hub / github.com/fatedier/frp / worker

Method worker

server/control.go:312–338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

310}
311
312func (ctl *Control) worker() {
313 xl := ctl.xl
314
315 go ctl.heartbeatWorker()
316 go ctl.msgDispatcher.Run()
317
318 <-ctl.msgDispatcher.Done()
319 ctl.sessionCtx.Conn.Close()
320
321 ctl.mu.Lock()
322 close(ctl.workConnCh)
323 for workConn := range ctl.workConnCh {
324 workConn.Close()
325 }
326 proxies := ctl.proxies
327 ctl.proxies = make(map[string]proxy.Proxy)
328 ctl.mu.Unlock()
329
330 for _, pxy := range proxies {
331 ctl.closeProxy(pxy)
332 }
333
334 metrics.Server.CloseClient()
335 ctl.sessionCtx.ClientRegistry.MarkOfflineByRunID(ctl.runID)
336 xl.Infof("client exit success")
337 close(ctl.doneCh)
338}
339
340func (ctl *Control) registerMsgHandlers() {
341 ctl.msgDispatcher.RegisterHandler(&msg.NewProxy{}, ctl.handleNewProxy)

Callers 1

StartMethod · 0.95

Calls 8

heartbeatWorkerMethod · 0.95
closeProxyMethod · 0.95
MarkOfflineByRunIDMethod · 0.80
InfofMethod · 0.80
RunMethod · 0.65
CloseMethod · 0.65
CloseClientMethod · 0.65
DoneMethod · 0.45

Tested by

no test coverage detected