Wed 24 Aug 2011 03:37:45 PM UTC, comment #6:
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
|