• AVR Freaks

AnsweredHot!UDP endurance Problem harmony2.06/mplabx5.05

Author
balakumaran
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2016/11/24 01:34:58
  • Location: 0
  • Status: offline
2019/05/20 03:37:15 (permalink)
0

UDP endurance Problem harmony2.06/mplabx5.05

Hi Everyone, I am using PIC32mz1024efg144 controller. I have to receive 20 UDP Data stream per second. I am able to receive UDP Stream for while. And It stopped working after 5 min or 10 min. but still pinging. I followed UDP_client_server example code from Harmony 2.06. I used to close and open server socket for Very transmission. lots of forum saying closing and opening will release memory.
Is it closing and opening required for transmission. I was reading all the RXPacket and discarding remaining packets. Below command are print through UART.
 
HeapInfo:

HEAP SIZE:39168
MAX SIZE:18984
FREE SIZE:27248
MARK SIZE:38288
Error Size:

Macinfo:
RxOKPac: 1057 RxPdBuf: 2 RxSdBuf: 2 RxErPac: RxFrErr:
TxOKPac: 284 TxPdBuf: TxErPac: TxQuFul:
FRMTXOK : 284
FRMRXOK : 1057
RXBUFCNT: 2
RXOVFLOW:
pERROR:
ALGNERR :

Whenever UDP Stop working TCP/IP_heap_High_waterMarkSize is keep on increasing. please give your valuable suggestions guys.
#1
NKurzman
A Guy on the Net
  • Total Posts : 17723
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: UDP endurance Problem harmony2.06/mplabx5.05 2019/05/20 06:09:45 (permalink) ☄ Helpfulby balakumaran 2019/05/20 20:33:03
0
This is a Harmony issue. You may have better luck cross posting it to the Harmony Forum.
 
Edit:
Never mind'  "rainad" found you.
post edited by NKurzman - 2019/05/20 15:08:36
#2
rainad
Super Member
  • Total Posts : 1209
  • Reward points : 0
  • Joined: 2009/05/01 13:39:25
  • Location: 0
  • Status: offline
Re: UDP endurance Problem harmony2.06/mplabx5.05 2019/05/20 11:04:56 (permalink) ☼ Best Answerby balakumaran 2019/05/20 20:33:11
5 (2)
Opening and closing a socket for every transmission is something that's highly inefficient and should be avoided - opening a socket is an expensive operation. Plus it may create heap memory fragmentation, depending on what type of heap you use.
Just open the socket and transmit/receive data with it until you're done.
This is how it's intended to be used.
 
 
#3
balakumaran
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2016/11/24 01:34:58
  • Location: 0
  • Status: offline
Re: UDP endurance Problem harmony2.06/mplabx5.05 2019/05/20 20:39:03 (permalink)
0
Thank you very much rainad.
Without Opening and Closing a socket for every transmission seem to be working. But I have to receive Udp data stream for continuous 8 hours a day. Udp streams may vary from 20 to 2 packets stream per second.  Is it good to use without closing a socket.
As per your suggestion I have rewrite code as follows
1. opening socket.
2. wait for connection.
3. read data / discard.
4. go to wait for connection(2).
 
please give your valuable suggestions guys.
 
 
 
 
#4
rainad
Super Member
  • Total Posts : 1209
  • Reward points : 0
  • Joined: 2009/05/01 13:39:25
  • Location: 0
  • Status: offline
Re: UDP endurance Problem harmony2.06/mplabx5.05 2019/05/21 07:08:28 (permalink)
0
Your loop looks OK.
Based on the messages that you receive, you probably have a way to stop the communication, close the socket, etc.
 
#5
Jump to:
© 2019 APG vNext Commercial Version 4.5