lwIP - A Lightweight TCP/IP stack - Bugs: bug #31084, socket API returns always EMSGSIZE...
You are not allowed to post comments on this tracker with your current authentication level.
bug #31084: socket API returns always EMSGSIZE on non-blocking sockets if data size > send buffers
Submitter: | Martin Velek <allew> | ||
Submitted: | Mon 20 Sep 2010 01:56:22 PM UTC | ||
Category: | sockets/netconn | Severity: | 3 - Normal |
Item Group: | Feature Request | Status: | Fixed |
Privacy: | Public | Assigned to: | goldsimon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | CVS Head |
Jump to the original submission
Wed 24 Aug 2011 03:37:45 PM UTC, comment #6: |
SandrineLWI1565 <nexvisionuser245> |
Fri 22 Jul 2011 08:06:43 PM UTC, comment #5: Fixed. Added a new function netconn_write_partly() (that adds a parameter to return how many bytes were written) to prevent changing the netconn API. |
Simon Goldschmidt <goldsimon> |
Fri 22 Jul 2011 06:17:44 PM UTC, comment #4: re original post:
|
Simon Goldschmidt <goldsimon> |
Tue 11 Jan 2011 02:03:14 PM UTC, comment #3: I agree with Simon's comment #2 but moving to 1.4.1 as I don't think this should prevent the release of 1.4.0. If you have a working solution though it's fine to commit it earlier. |
Kieran Mansley <kieranm> |
Mon 22 Nov 2010 09:07:43 PM UTC, comment #2: This is a bit more tricky, since we should not only be able to send if((size > TCP_SND_BUF) || ((size / TCP_MSS) >
|
Simon Goldschmidt <goldsimon> |
Sun 21 Nov 2010 03:29:35 PM UTC, comment #1: Yep, seems like sending as much as possible is the way to go. It's not as if we did this deliberately, I guess: it's only not been implemented, yet. |
Simon Goldschmidt <goldsimon> |
Mon 20 Sep 2010 01:56:22 PM UTC, original submission:
I would like to open discussion about sending data over LWIP socket API(1.4.x) in the non-blocking or MSG_DONTWAIT mode.
|
Martin Velek <allew> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
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 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2011-07-22 | goldsimon | Status | In Progress | Fixed | |
Open/Closed | Open | Closed | |||
2011-01-11 | kieranm | Planned Release | 1.4.0 | 1.4.1 | |
2010-11-22 | goldsimon | Status | None | In Progress | |
Assigned to | None | goldsimon | |||
Planned Release | 1.4.0 |
Powered by Savane 3.13-d3ae.
Corresponding source code
Hello All,
I use lwip-1.4.0. I need using non-blocking socket. So I have applied patch done at 2011-07-22 20:05:24 on the Git master branch. I have only done changes described in this commit on the 1.4.0 release version.
I call lwip_send(1, data=0x2000c030, size=2050, flags=0x0) on a socket alreay in non blocking mode (no need using MSG_DONTWAIT flag).
Unfortunally, it fails with logs
lwip_send(1, data=0x2000c030, size=2050, flags=0x0)
tcp_write(pcb=0x20001810, data=0x2000c030, len=1072, apiflags=1)
tcp_write: queuelen: 0
tcp_write: queueing 6511:7047
tcp_write: queueing 7047:7583
tcp_write: 2 (after enqueued)
tcp_output_segment: 6511:7047
lwip_send(1) err=0 written=1072
lwip_send(1, data=0x2000c460, size=978, flags=0x0)
do_writemore: No more tcp_sndbuf available
lwip_send(1) err=-7 written=0
where "do_writemore: No more tcp_sndbuf available" is a log in code
do_writemore(struct netconn *conn)
{
....
available = tcp_sndbuf(conn->pcb.tcp);
if (available < len) {
/* don't try to write more than sendbuf */
len = available;
if (dontblock){
if (!len) {
LWIP_DEBUGF(SOCKETS_DEBUG, ("do_writemore: No more tcp_sndbuf available\n"));
err = ERR_WOULDBLOCK;
goto err_mem;
}
} else {
.......
Do you think the patch is correct on 1.4.0 version or do I need the GIT master version? Do I have a problem with my buffers's size in opt.h?
Best Regards
Sandrine