lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Choosing the right lwip API...


From: Jonathan Larmour
Subject: Re: [lwip-users] Choosing the right lwip API...
Date: Wed, 21 Jan 2009 02:55:51 +0000
User-agent: Mozilla Thunderbird 1.0.8-1.1.fc3.4.legacy (X11/20060515)

DownyTif wrote:
Hi all,

I was wondering what API I should use to do what I want to do. By the way,
I'm new to the mail-list/forum and lwip world. I tried to find the
differences between the Raw, sockets or sequential (netconn) APIs, but I
haven't found anything useful.

http://lwip.wikia.com/wiki/LwIP_Wiki has a lot of stuff about the APIs. In essence the raw API is event-driven, the sequential (netconn) API, is a more traditional API with calls to e.g. netconn_write() which can block until the operation completes, and the sockets API is the same sort of thing as the sequential API, but using the well-known BSD sockets functions (like socket(), bind(), listen() accept(), etc.).

Each API (raw->sequential->sockets) in turn has more overhead (both code and data) and is slightly slower than the previous one, and for some hardware, you can get much better performance with the raw or sequential APIs than the sockets API in some situations, but that doesn't mean the sequential or sockets APIs are slow. If performance is critical for you (and your other mail implies this might be tree) it could be that the raw API is a better choice. Although you have to do more things yourself with the raw API.

So, I was thinking that maybe the sequential API (netconn) was not the way
to go.

It's unrelated to your other mail about large packet sizes. An event-driven model such as the raw API affects your program design a lot. Some people like the familiarity of the sockets API if they've used it elsewhere, or if they are reusing existing code. It's a choice with trade-offs between them, which is why lwIP has all three!

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine




reply via email to

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