I want to send a large http packet. 200KB length. But I can only work with a 4KB buffer to dynamically generate the web page. I tried several ways and all of them did not work. Seems tcp_write() function is doing some queueing internally and I don't understand its logic. Anyway, I think it should be a common problem for RAM limited controllers. I wonder how you guys handle sending big packets when RAM is limited?
/* Tell TCP that we wish be to informed of data that has been
successfully sent by a call to the http_sent() function. */ tcp_sent(pcb, http_sent); static void send_data(struct tcp_pcb *pcb, struct http_state *hs) { err_t err; u16_t len;
/* We cannot send more data than space avaliable in the send buffer. */ if (tcp_sndbuf(pcb) < hs->left) { len = tcp_sndbuf(pcb); } else { len = hs->left; }