Forum Discussion
Altera_Forum
Honored Contributor
14 years agoIf you have a while loop with a send() and no kind of flux control, the described problem is pretty normal: the transmitting server will continously queue data until it finds free memory, but on the other side the receiver part will not have neither memory, nor cpu time to manage incoming data.
If you use uC/OS, a simple solution would be inserting a TK_SLEEP(1) macro in the while loop; this will momentarily release the control to other tasks, in particular the receiver one. However the sleep solution could lead to some performance issues if your application is supposed to transmit lot of data, possibly for streaming; infact you have a 1ms idle time for every send call. So you must devise a flux control method at your application level, for example requiring an answer from client after you have sent a specified amount of data.