lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] tcp_sent() callback: Called once per sent packet or for mul


From: Matthias Paul
Subject: [lwip-users] tcp_sent() callback: Called once per sent packet or for multiple packets at once?
Date: Thu, 3 Feb 2022 15:51:59 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

Hello all,

I'm using lwip 2.1.2 in non-OS / non-threaded mode (main loop mode) with raw API to send/receive TCP packets.

When sending packets with tcp_write() I'd like to use zero copy mechanism. Therefore I need to keep the pbuf objects until the buffer has been sent and acknowledged by the recipient. When acknowledged, my callback registered by tcp_sent() is called:

static err_t
TCPSERVER_sentCallback(
        void                        * arg,
        struct tcp_pcb                * tcpPcb,
        uint16_t                    length) {
   // remove pbuf which are reported as "sent"
   ...
}

Is "length" always matching a single pbuf length or could it happen that TCPSERVER_sentCallback() reports multiple pbuf objects at once?

Also, can I assume, that TCPSERVER_sentCallback() is called in the order the packets have been sent?


Thank you for reading,

Paul


reply via email to

[Prev in Thread] Current Thread [Next in Thread]