MCPcopy
hub / github.com/ph4ntonn/Stowaway / downStreamOffline

Function downStreamOffline

agent/process/offline.go:402–428  ·  view source on GitHub ↗
(mgr *manager.Manager, options *initial.Options, uuid string)

Source from the content-addressed store, hash-verified

400}
401
402func downStreamOffline(mgr *manager.Manager, options *initial.Options, uuid string) {
403 childrenTask := &manager.ChildrenTask{ // del the child
404 Mode: manager.C_DELCHILD,
405 UUID: uuid,
406 }
407
408 mgr.ChildrenManager.TaskChan <- childrenTask
409 <-mgr.ChildrenManager.ResultChan
410
411 sMessage := protocol.PrepareAndDecideWhichSProtoToUpper(global.G_Component.Conn, global.G_Component.Secret, global.G_Component.UUID)
412
413 header := &protocol.Header{
414 Sender: global.G_Component.UUID,
415 Accepter: protocol.ADMIN_UUID,
416 MessageType: protocol.NODEOFFLINE,
417 RouteLen: uint32(len([]byte(protocol.TEMP_ROUTE))),
418 Route: protocol.TEMP_ROUTE,
419 }
420
421 offlineMess := &protocol.NodeOffline{
422 UUIDLen: uint16(len(uuid)),
423 UUID: uuid,
424 }
425
426 protocol.ConstructMessage(sMessage, header, offlineMess, false)
427 sMessage.SendMessage()
428}
429
430func tellAdminReonline(mgr *manager.Manager) {
431 childrenTask := &manager.ChildrenTask{

Callers 1

Calls 3

ConstructMessageFunction · 0.92
SendMessageMethod · 0.65

Tested by

no test coverage detected