lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] socket functionality - nonblocking?


From: Jonathan Larmour
Subject: Re: [lwip-users] socket functionality - nonblocking?
Date: Tue, 25 Nov 2008 15:22:46 +0000
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

Rishi Khan wrote:
> listen is blocking? Maybe you mean accept? In any case, I have code that
> makes accept non-blocking and I sent it in as a patch before ... not
> sure if it made it's way to the CVS repository.

It did, so accept does indeed support non-blocking mode in CVS (but not in
lwIP 1.3.0).

The basics of non-blocking connect() are simple - it's doing the proper
error handling that is a little bit trickier. That means not letting the
socket be fully usable until connected, setting the correct error codes
such that getsockopt(SO_ERROR...) works, and posting an API event so that
select would wake up. That probably also means changing alloc_socket to
initialise sendevent to 0.

Non-blocking send should be very easy I would have thought. Just check for
sock->sendevent==0 in lwip_send() before calling netconn_write(). I would
have thought anyway.

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.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine




reply via email to

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