lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] a beginners questions about lwip, sockets and threads


From: ake . forslund
Subject: Re: [lwip-users] a beginners questions about lwip, sockets and threads
Date: Wed, 25 May 2011 09:15:04 +0200

Right, so I guess the best idea is to keep the sockets local and per thread. In my final application I will have a single thread communicating with the outside world over tcp/ip so this won't be a problem. Out of curiosity, can sockets usually (in other implementations) be shared between threads?

/Åke

-----------------------------
Åke Forslund
0433-273296
NIBE AB
Box 14
S-285 21  Markaryd
Tel +46-(0)433-273296



From: "address@hidden" <address@hidden>
To: Mailing list for lwIP users <address@hidden>
Date: 2011-05-24 19:09
Subject: Re: [lwip-users] a beginners questions about lwip,        sockets and threads
Sent by: address@hidden





Kieran Mansley wrote:
> On Tue, 2011-05-24 at 15:14 +0200, address@hidden wrote:
>> 1. Can I use threads? One to receive and one to transmit data and
>> then
>> check if the data arrives correctly?
> You can, but I would do it all in one thread, and use poll() to
> determine when each socket needs attention (either sending or
> receiving).

Actually, there's one limitation here I have to point out for completeness:

You may *not* share one sockets between multiple threads. So while you
are allowed to receive on socket A in one thread and send on socket B in
another thread, you may *not* receive on socket A in one thread an send
on the same socket A in any other thread!


Simon

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

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