[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Knowing when TCP data has been sent
From: |
Sägesser Walter |
Subject: |
[lwip-users] Knowing when TCP data has been sent |
Date: |
Mon, 22 Mar 2010 14:00:15 +0100 |
Hi
In the raw API there
is a dedecated callback that tells me that the data is out and confirmed. I have
been looking for something similar in the netconn API (in order to know when a
buffer used in netconn_write can be freed without having to use
NETCONN_COPY). I tried creating a netconn
using
"xNetConn = netconn_new_with_callback ( NETCONN_TCP, NetConnClientCallback );" //
netconn kept alive until no transfer for a few
seconds
// called in the
context of the TCP thread
statuc void NetConnClientCallback ( TNetConn aConn, ENetEvent
aEv, UInt16 aLen )
{
if ( aEv == NETCONN_EVT_SENDPLUS
)
{
mClientSendCnt
-= aLen;
if ( mClientSendCnt == 0 )
RTOS_SemPost ( gSemTcpClnHandle );
}
} // NetConnClientCallback
Basically it works, i.e. the semaphore is eventually posted, but
unbearably slow (delay of ca. 200ms for each frame). Without this callback,
using NETCONN_COPY for netconn_write, the throughput is at least 120 times
better. Thus I conclude that I have misused the callback function for something
it is not designed for. On the other hand I do not find a better way to get a
"done" trigger. Is there a better way or do I have to copy the outgoing data
(which would violate the concept of a non-copy
interface)?
Walter
_____________________________
SOLON Inverters AG
Burgerfeldstrasse
19
CH-8730 Uznach SG, Schweiz
Phone: +41 55 246 41
14
Direct: +41 55 246 58 52
Fax:
+41 55 246 41 16
www.solon.com
- [lwip-users] Knowing when TCP data has been sent,
Sägesser Walter <=