[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #31084] socket API returns always EMSGSIZE on non-bloc
From: |
Martin Velek |
Subject: |
[lwip-devel] [bug #31084] socket API returns always EMSGSIZE on non-blocking sockets if data size > send buffers |
Date: |
Mon, 20 Sep 2010 13:56:23 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 (.NET CLR 3.5.30729) |
URL:
<http://savannah.nongnu.org/bugs/?31084>
Summary: socket API returns always EMSGSIZE on non-blocking
sockets if data size > send buffers
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: allew
Submitted on: Mon 20 Sep 2010 01:56:22 PM GMT
Category: sockets
Severity: 3 - Normal
Item Group: Feature Request
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release:
lwIP version: CVS Head
_______________________________________________________
Details:
I would like to open discussion about sending data over LWIP socket
API(1.4.x) in the non-blocking or MSG_DONTWAIT mode.
The current implementation returns always EMSGSIZE if data size is more than
((size > TCP_SND_BUF) || ((size / TCP_MSS) >
TCP_SND_QUEUELEN)). I cannot find exact description of this situation but I
think that lwip should send as much as possible(and returns less than
required) and if the output buffer is full it would return -1 with error
EAGAIN or EWOULDBLOCK.
I have discovered this behavior during playing with xavante http
server + luasockets and LWIP socket API. Every accepted connection has option
TCP_NODELAY and O_NONBLOCK. Every attempt to send data(larger html page)
failed with EMSGSIZE.
I have tried similar behavior with Ubuntu 10.04.1 LTS,
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (int *)&optval,
sizeof(optval));
fcntl(sockfd, F_SETFL,O_NONBLOCK);
perror("");
n = write(newsockfd, buff, x);
perror("");
Only with big x (e.g. 655360) there is
Success
Success
n = 212992
Martin
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?31084>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] [bug #31084] socket API returns always EMSGSIZE on non-blocking sockets if data size > send buffers,
Martin Velek <=