Here is a snippet of a function that sends data.
err_t err = ERR_OK;
u16_t len;
/* We cannot send more data than space available in the send
buffer. */
if (tcp_sndbuf(pcb) < ps->left) {
len = tcp_sndbuf(pcb);
} else {
len = ps->left;
}
if (len > 0) {
err = tcp_write(pcb, ps->buf_p, len, 1);
}
Sathya
On 2/14/06, 陳 小擁 <[EMAIL PROTECTED]> wrote:
Hi Sathya:thanks for your help. however, how can i check the tcp send buffer? which function can i use ? or i have to write it by myself ? someone have told me that if i want to use tcp_write , i have use tcp_output follow it .> temp_pcb = tcp_active_pcbs ;
> err = tcp_write(temp_pcb , &abc[j] , sizeof(abc[j]),0) ;
> tcp_output(temp_pcb) ;is it right? thanks again !
You will need to keep checking the tcp send buffer for the amount of space left in the buffer before you call tcp_write. Keep calling a function that checks the tcp snd buf for space available and send accordingly.
hope this helps
Sathya_______________________________________
YM - 離線訊息
就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
http://messenger.yahoo.com.hk
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
