patchlwIP - A Lightweight TCP/IP stack - Patches: patch #5211, Sockets: Non-blocking write support

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #5211: Sockets: Non-blocking write support

Submitter:  None
Submitted:  Thu 29 Jun 2006 09:55:35 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Closed Planned Release:  None

Mon 19 Feb 2007 11:05:51 AM UTC, comment #3: 

I'd be much more inclined to take a proper fix that broke an API (as suggested by Michael Williamson) than a partial fix that doesn't.

Closing this for now.

Kieran Mansley <kieranm>
Group Member
Sat 18 Nov 2006 09:02:45 PM UTC, comment #2: 

As this is a useful feature and is a step towards full BSD sockets compliance, how about providing a second API such as:

netconn_write_extended (..oldparams.., u8_t block_flag)
{

}

The netconn_write() API can then remain as a simple wrapper function:

netconn_write (..oldparams..)
{
  return (netconn_write_extended (..., TRUE));
}

The sockets layer can take advantage of the new API, while still retaining backwards compatibility.

I used this method recently to implement non-blocking connect() calls.

Anonymous
Fri 20 Oct 2006 07:25:51 PM UTC, comment #1: 

We tried this patch.  It is not adequate.  The problem is that there are multiple ways for the transport layer (tcp_enqueue) to declare failure and not complete a posted write.

We were able to "break" this fix by posting lots of small writes one at a time to the socket.   Tf the number of segments queued for the given connection would exceed the total number allowable (even though there is enough send buffer space) the tcp thread will fail to post the data, and you'll still lock.

The proper place to fix this is in the netconn_write() function, we've successfully patched it internally but changed the API in doing so (in order to support the flags option in addition to the ioctl() technique).  We've hesitated posting this as it those folks using the raw api would likely bristle at the change.


michael williamson <mawillia>
Thu 29 Jun 2006 09:55:35 AM UTC, original submission:  

The attached patch adds non-blocking support to lwip_send().

It checks the TCP sndbuf to find if space is available before calling netconn_write(). If enough space is available, the write will go ahead. If not enough space is available, the call returns. The result is that the call will not block on space becoming available in the sndbuf. Write sockets can be added to select() to find out when sndbuf space becomes available.

Kelvin Lawson.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #10267:  non-blocking-writes.patch added by None (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by kieranm (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-02-19 kieranm StatusNone Wont Do
        Open/ClosedOpen Closed
    2006-06-29 None Attached File- Added non-blocking-writes.patch, #10267

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code