()
| 691 | } |
| 692 | |
| 693 | func (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 | |
| 723 | func (s *UdpServer) recvMessageRoutine() { |
| 724 | defer s.wg.Done() |
no test coverage detected