{
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%"S32_F"): returning
EWOULDBLOCK\n", s));
sock_set_errno(sock, EWOULDBLOCK);
return -1;
}
}
before this:
newconn = netconn_accept(sock->conn);
Essentially, I took this from lwip_recvfrom.
John L., you may want to test/commit this too.
Tamas Somogyi wrote:
Hi,
It seems that lwip_accept() blocks the calling thread even if the
listening socket is set to non-blocking mode - see sample code below.
Is it the normal behaviour or a bug?
Normal behaviour. Only non-blocking reads are implemented in lwip.
However lwIP does have receive timeouts, which also affect accepts.
Perhaps
that might be useful. Enable LWIP_SO_RCVTIMEO in lwipopts.h, and do a call
to lwip_setsockopt, e.g.:
int timeout = 1000; /* 1000 msecs */
err = lwip_setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout,
sizeof(timeout));
Jifl
--
eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------ Opinions==mine
>>>> Visit us on stand 905 at the Embedded Systems Show 2008 <<<<
>>>> Oct 1-2, NEC, Birmingham, UK http://www.embedded.co.uk <<<<
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users