[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-devel] [task #7865] implement non-blocking SEND operation(sock
From: |
Pettinato, Jim |
Subject: |
RE: [lwip-devel] [task #7865] implement non-blocking SEND operation(socket) |
Date: |
Thu, 20 Mar 2008 10:33:01 -0400 |
Do you really need to implement another queue, or could you just have it
return an error eg ERR_WOULD_BLOCK if there is no longer room on the
existing TCP send queue, and let the task retry later?
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of Jonathan Larmour
Sent: Thursday, March 20, 2008 10:25 AM
To: Jonathan Larmour; piero; address@hidden
Subject: [lwip-devel] [task #7865] implement non-blocking SEND
operation(socket)
Follow-up Comment #1, task #7865 (project lwip):
As background, Piero is primarily concerned with the BSD sockets
interface.
lwIP does implement O_NONBLOCK in the sockets layer, but only for rx.
Not for tx.
It's easy to make the first write non-blocking just by always waking up
the caller, but to allow subsequent ones to be non-blocking before the
first write's data is completely sent would require being able to store
a list of pending writes. I don't think the implementation would be
meaningful until the code does that.
Obviously you need to check against tcp_sndbuf before deciding whether
to return EAGAIN immediately or append to that list. I'm not sure
whether there should also be a check against the send queue length
(TCP_SND_QUEUELEN). If there was, there would have to be some
consideration of when to trigger:
API_EVENT(conn, NETCONN_EVT_SENDPLUS, len); for the use of
lwip_select().
As a result, to keep things simple I think it's probably best just to
accept the data for writing anyway. At least for now. Other opinions
welcome.
(Especially since I at least won't be able to work on this for some
time).
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/task/?7865>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
_______________________________________________
lwip-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-devel