Hi,

I am using the TCP raw API for a tiny-tiny telnet implementation. I am 
enqueuing output data using tcp_write(). Actually I am currently using 
tcp_write() to do all the queueing job by calling it even 10 or 20 times 
in a row with small amount of data, especially when output is mostly 
made of static strings.

Finally, once the telnet output of the processed shell command is 
enqueued, I am calling tcp_output() in order to improve telnet shell 
responsiveness.

While I am queuing less data than TCP_MSS, everything works perfectly. 

However, if I am queueing more than TCP_MSS but still less than 
TCP_SND_BUF, I am starting having the following assert:

"last_unsent->oversize_left >= oversize_used
unsent_oversize mismatch (pcb->unsent is NULL)"


Generally followed by this assert for each next tcp_write():

"tcp_write: pbufs on queue => at least one queue non-empty
tcp_receive: valid queue length"


Note that tcp_write() always returns ERR_OK. Also, I am calling 
tcp_write() and tcp_output() out of the lwIP thread, I supposed the lwIP 
RAW API thread safe.


Here are the relevant part of lwipopts.h:

#define MEMP_NUM_TCP_PCB                10
#define MEMP_NUM_TCP_PCB_LISTEN         1
#define MEMP_NUM_TCP_SEG                12
#define TCP_TTL                         255
#define TCP_WND                         2048
#define TCP_QUEUE_OOSEQ                 1
#define TCP_MSS                         1024
#define TCP_SND_BUF                     2048
#define TCP_SND_QUEUELEN                6 * TCP_SND_BUF/TCP_MSS
#define TCP_MAXRTX                      6
#define TCP_SYNMAXRTX                   6


What I am doing wrong ? :-)

Thank you very much.

Sylvain

Attachment: signature.asc
Description: Digital signature

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to