-->
Page 1 of 1

Packet queuing broken in SDK 1.3.0?

PostPosted: Sat Aug 15, 2015 11:51 pm
by cnlohr
Until now, with all of my applications, I would see if there was room left in the TCP send buffer before sending packets, using: espconn_get_packet_info


Code: Select allint8_t TCPCanSend( struct espconn * conn, int size )
{
   struct espconn_packet infoarg;
   sint8 r = espconn_get_packet_info(conn, &infoarg);

   if( infoarg.snd_buf_size >= size && infoarg.snd_queuelen > 0 )
      return 1;
   else
      return 0;
}


But, in the newest release, if there is still buffer room left, and I try to send, I get an error sending and no packet is sent. I've modified my code to see if all packets have been sent and acked. Then and only then do I send another packet. While this solution works dandy for Linux, mobile, OSX, it's unlikely to work for many windows applications because of their pesky forced delayed acks.

Any idea if I need to do something to turn the ability to queue packets back on?

P.S. Tested with 1.2.0 a-okay, completely broken on both applications in 1.3.0.

Re: Packet queuing broken in SDK 1.3.0?

PostPosted: Sun Aug 16, 2015 2:59 am
by eriksl
?

The SDK specifies that you should only send one packet a time and that you should wait for the callback (no need for polling).

Re: Packet queuing broken in SDK 1.3.0?

PostPosted: Mon Aug 17, 2015 9:45 am
by cnlohr
Well, my architecture works much better with polling (and keeps it cross-platform with the AVR) BUT!!!

Without queuing packets, Windows- systems often behave very poorly, delaying their ack's. All of the SDKs up to this point supported queuing as well. That is a heck of a feature to drop, even if it was never fully supported.

Re: Packet queuing broken in SDK 1.3.0?

PostPosted: Mon Aug 17, 2015 2:04 pm
by eriksl
I don't see why you have problems. Just make sure the next data is available when the "data sent" callback is called and send it immediately.