lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Nonblocking sockets problem


From: address@hidden
Subject: Re: [lwip-users] Nonblocking sockets problem
Date: Wed, 14 Mar 2012 19:26:10 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

Åke Forslund wrote:
I see my mistake there, however even with code that is at least theoretically 
sane I can't establish a connection. lwip_accept() always returns EWOULDBLOCK 
for me.

from socket debug:
lwip_accept(0)...
lwip_accept(0): returning EWOULDBLOCK
[Repeats forever]

putty reports "Connection closed by remote host" followed by "Network error: Software caused 
connection abort" or "Connection reset by Peer"

I have pasted your code into test.c in the Win32 port from contrib, removed your application-specific code, checked the return value of lwip_accept() and I could successfully connect using telnet.exe provided with windows XP.

If it's not working for you, that suggests a problem either in your port or in the client application, I guess... What are the thread priorities in your system? Are you sure there is only one thread active in lwIP at a time? Because that's the main difference between the blocking and your non-blocking version: the blocking version just sits there and waits for a callback that lets lwip_accept return, while the non-blocking version calls into tcpip_thread *very* often - if your threading is broken, there's a good chance this will be revealed by your way of using non-blocking sockets.

Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]