[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] netconn_recv blocked
From: |
Jonathan Larmour |
Subject: |
Re: [lwip-users] netconn_recv blocked |
Date: |
Wed, 19 Dec 2007 02:38:05 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501) |
Chien-Lung Wu wrote:
8. My questions:
Q1. I am sure DHCP server sent out DHCPOFFER packets
(broadcasting);
HOW can client to receive such broadcast packet?
Should I rebind the socket/connect again
(Netconn_bind(conn, IP_ADDR_ANY, DHCP_CLIENT_PORT);)
No.
I suspect since you aren't using the lwIP DHCP client, that you therefor
do not have LWIP_DHCP enabled. That means a magic bit of code in
core/ipv4/ip.c does not get triggered. I suggest you look at that file
(search for LWIP_DHCP in that file) as you'll need that code.
Q2. The netconn_recv(conn) seems been blocked!
Are there any ways to have timeout mechanism to unblock the
process
After certain time?
If you are using CVS, you can enable LWIP_SO_RCVTIMEO. There isn't an
official API function to then set the timeout, but you do it by assigning
to the 'recv_timeout' member of the 'struct netconn'.
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.
------["The best things in life aren't things."]------ Opinions==mine