[Top][All Lists]

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

[lwip-users] How to check send state?

From: Karl Karpfen
Subject: [lwip-users] How to check send state?
Date: Mon, 15 Sep 2014 20:59:32 +0200


within my lwIP application (TCP with permanent connection) I'm sending some data out of main-loop (no interrupt context) and start submission by calling


Sending of data is done via tcp_write(). Within the send function itself amount of data already sent is stored in a variable sentLength. Now to find out if it is possible to send next bunch of data I check this variable. When its size is equal to the length of the previous data buffer, sending was completed and I start submission of next buffer.

My problem here: sentLength is manipulated out of interrupt context while checking it for completion is done out of main loop. It seems this sometimes causes troubles, at receiver side I can see incomplete frames.

So my question: what is the correct way to find out if currentPcb has finished sending (or better has pushed all data to tcp_write()) and is ready to accept next bunch of data?


reply via email to

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