[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] a beginners questions about lwip, sockets and threads
From: |
Luca Ottaviano |
Subject: |
Re: [lwip-users] a beginners questions about lwip, sockets and threads |
Date: |
Tue, 24 May 2011 15:36:06 +0200 |
Hi Åke,
On mar, 2011-05-24 at 15:14 +0200, address@hidden wrote:
> My questions are:
> 1. Can I use threads? One to receive and one to transmit data and then
> check if the data arrives correctly?
Yes, you can. I only have experience with sockets API (which in my
opinion is simpler to use), but that has never been a problem.
> 2. Should I use TCP or UDP-sockets (SOCK_STREAM/SOCK_DGRAM)
That depends on your application. Bear in mind that both types use
netconn connections below, so you need to configure a number of netconn
equal or more than the number of TCP + UDP sockets that you plan to use.
> 4. I'm currently running 1.3.2 is there any reason to upgrade to 1.4.0
> besides the new number?
With 1.4.0 you get many new features and the OS layer is much simpler to
implement.
> I've already tried to start thread-to-thread-communication with
> sockets but I'm quite inexperienced when it comes to working with
> sockets so I might have done some trivial mistake. My init sequence
> and socket-code can be found here: http://pastebin.com/ScSZ7fYKif
> anyone has a slow afternoon and feel like nitpicking =)
If you use the sockets API, you can develop and debug your threads as
different processes on PC. Porting to lwip is just a matter of adding
lwip_ prefix to posix calls.
I suggest that you start coding one process and use netcat (or
equivalent) on the other end.
Cheers,
--
Luca Ottaviano - address@hidden
Develer S.r.l. - http://www.develer.com/
.hardware .software .innovation
Tel.: +39 055 3986627 - ext.: 218