MCPcopy
hub / github.com/OpenNHP/opennhp / sendMessageRoutine

Method sendMessageRoutine

endpoints/server/udpserver.go:693–721  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

691}
692
693func (s *UdpServer) sendMessageRoutine() {
694 defer s.wg.Done()
695 defer log.Info("sendMessageRoutine stopped")
696
697 log.Info("sendMessageRoutine started")
698
699 for {
700 select {
701 case <-s.signals.stop:
702 return
703
704 case md, ok := <-s.sendMsgCh:
705 if !ok {
706 return
707 }
708 if md.PrevParserData != nil && s.device.IsTransactionResponse(md.HeaderType) {
709 // forward to a specific transaction
710 transaction := md.ConnData.FindRemoteTransaction(md.PrevParserData.SenderTrxId)
711 if transaction != nil {
712 transaction.NextMsgCh <- md
713 continue
714 }
715 }
716
717 // generic send
718 s.device.SendMsgToPacket(md)
719 }
720 }
721}
722
723func (s *UdpServer) recvMessageRoutine() {
724 defer s.wg.Done()

Callers 1

StartMethod · 0.95

Calls 3

IsTransactionResponseMethod · 0.80
FindRemoteTransactionMethod · 0.80
SendMsgToPacketMethod · 0.80

Tested by

no test coverage detected