lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Normal way how highlevel API interfaces with stack ?!


From: K.J. Mansley
Subject: Re: [lwip-users] Normal way how highlevel API interfaces with stack ?!
Date: 01 Dec 2004 14:54:05 +0000

On Wed, 2004-12-01 at 14:43, Bonny Gijzen wrote:
> ----- Original Message -----
> From: "K.J. Mansley" <address@hidden>
> Subject: Re: [lwip-users] Normal way how highlevel API interfaces with stack
> ?!
> 
> > Normally the sockets API will return to the application (with no error -
> > i.e. success) before the data have even been transmitted once.  Usually
> > the send() function returns when it has successfully put something on a
> > queue of things to be sent.  It does not wait until the data are
> > actually transmitted, and certainly doesn't wait until the data have
> > been acknowledged, before it returns.
> 
> OK, this I understand. Its the non-blocking way sort of I think.

It's not just the non-blocking way of doing things: even a blocking
send() call will not wait for an acknowledgement (it would cripple
performance to do so, and prevent streaming of data) before it returns
to the application.  Here, the difference between a blocking and
non-blocking send() is the blocking one will wait for space on the
"queue of things to be sent", whereas the non-blocking one would just
return with EWOULDBLOCK or something.

> Ofcourse I can think of mechanisms in where my highlevel code informs lwIP
> to stop doing something, but I guess all stacks suffer this problem. So how
> is this normally handled inside stacks?

It's not handled within stacks.  If the sending application needs to
know if the receiver has got something, they have to communicate that
between them somehow.  i.e. have application level acknowledgements. 
TCP is reliable in the sense that it guarantees that everything given to
the receiver is in-order and probably error free (i.e. it passed the
checksum).  It does not guarantee that everything sent will be
received.  If you need that guarantee you have to provide it yourself
with an application layer protocol.  To tell the difference between
different frames that you application sends, and different responses it
gets (so as to avoid the confusion you mention) this protocol will
probably need some sort of sequence number.

As I said, this is not really specific to lwIP, and I can refer you to
some books if that would help.

Kieran





reply via email to

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