I have been studying the TCP connection technology and think I understand but I have some questions.
I believe that what I need to do is form a connection and then execute an espconn_sent() API call. This takes a buffer and a length and, I presume, sends the data. I notice that the length is an unsigned 16 bit value ... so that tells me that I can only send 16KBytes in one operation. Is that correct?
I am assuming that, like all the other SDK APIs, this command does not block. So that seems to say that I can call espconn_sent() and then immediately call a second espconn_sent() ... however ... my belief is that would be wrong. Instead, one should send data via espconn_sent() and return control back to the OS. When a sent_callback occurs, that is an indication that the data previously asked to be sent has now ACTUALLY be sent and we can repeat and send new data.
Is this assumption correct?
How to send data over a TCP connection ...
Re: How to send data over a TCP connection ...
Postby tve » Thu Jul 09, 2015 12:50 pm
sorry to say, but you're pretty far off. after espconn_sent you need to wait for a callback that tells you that the buffer got sent. There are two flavors of callbacks depending on whether you asked the SDK to buffer or not. And you can't send that much at a time, I believe the send buffer is 2600 bytes or thereabouts, unless you use the 536 byte MSS version of liblwip... I recommend you read some open source code out there
. https://github.com/jeelabs/esp-link/blo ... pd/httpd.c might be one place to start, Espressif also has some demos...

Re: How to send data over a TCP connection ...
Postby kolban » Thu Jul 09, 2015 10:26 pm
Howdy Tve,
I really do appreciate your feedback. Its hard to find skilled folks in ESP8266 that I can chat with. Can I ask a favor though ... can you read my post again ... I'm missing what my error in understanding is ... as far as I can tell, your response is very, very similar to what I was thinking was happening ... and of course, I may be missing the wood from the trees ... if you can point out where my understanding is wrong, that would be awesome.
If you need an ESP8266 buddy to shoot the breeze with, let me know .. I'll be happy to exchange emails and skypes to chat.
Neil
I really do appreciate your feedback. Its hard to find skilled folks in ESP8266 that I can chat with. Can I ask a favor though ... can you read my post again ... I'm missing what my error in understanding is ... as far as I can tell, your response is very, very similar to what I was thinking was happening ... and of course, I may be missing the wood from the trees ... if you can point out where my understanding is wrong, that would be awesome.
If you need an ESP8266 buddy to shoot the breeze with, let me know .. I'll be happy to exchange emails and skypes to chat.
Neil
Who is online
Users browsing this forum: No registered users and 30 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.