File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,12 @@ size_t EthernetUDP::write(const uint8_t *buffer, size_t size)
118118int EthernetUDP::parsePacket ()
119119{
120120 // discard any remaining bytes in the last packet
121- flush ();
121+ while (_remaining) {
122+ // could this fail (loop endlessly) if _remaining > 0 and recv in read fails?
123+ // should only occur if recv fails after telling us the data is there, lets
124+ // hope the w5100 always behaves :)
125+ read ();
126+ }
122127
123128 if (recvAvailable (_sock) > 0 )
124129 {
@@ -206,14 +211,7 @@ int EthernetUDP::peek()
206211
207212void EthernetUDP::flush ()
208213{
209- // could this fail (loop endlessly) if _remaining > 0 and recv in read fails?
210- // should only occur if recv fails after telling us the data is there, lets
211- // hope the w5100 always behaves :)
212-
213- while (_remaining)
214- {
215- read ();
216- }
214+ // TODO: we should wait for TX buffer to be emptied
217215}
218216
219217/* Start EthernetUDP socket, listening at local port PORT */
You can’t perform that action at this time.
0 commit comments