|
From: | Bonny Gijzen |
Subject: | [lwip-users] Normal way how highlevel API interfaces with stack ?! |
Date: | Wed, 1 Dec 2004 14:32:05 +0100 |
Hi,
I am trying to understand how (highlevel) BSD
style API interfaces with any IP stack (like lwIP).
Let me try to explain my issue/question with an
example.
Highlevel API:
if (SendSomeData(&send_buf, len,
send_timeout)==RES_OK)
{
if (WaitForData(&receive_buf, 10,
rec_timeout)==10)
{
//successfully received my response, do
something with it
} else {//some error like timeout or too few
databytes received}
} else {//some error during sending of
data} My question is what will happen if one of the 2
highlevel functions fail?
Assume the SendSomeData() fails. This means
normally (I think) that an ACK is not received yet in lowlevel land.
This means this piece of data is being
retransmitted some number of times.
Assume my timeout is set to 5 seconds.
So in highlevel land, after 5 seconds I fall
through and do nothing (or some error code).
But in lowlevel land this data is still being
retransmitted until the MAXRETRY.
In theory MAXRETRY can occur much later than the
timeout value in highlevel land.
So it could be that the sent frame is successfully
retransmitted, even after the highlevel function has failed and
exitted.
I would think that the highlevel function needs to
tell lwIP that this frame no longer needs to be retransmitted. But is this a
normal way for a highlevel function to interface with the stack ?
Or are other approaches used?
(Similar thing can happen if the highlevel function
timesout, tells lwIP to stop with this frame,
but at the same time the ACK arrives ... so the
other side *has* received this frame, while the highlevel user thinks the other
side hasn't)
Excuse my ignorance on this matter,
Bonny |
[Prev in Thread] | Current Thread | [Next in Thread] |