lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] netconn_recv blocked


From: Chien-Lung Wu
Subject: RE: [lwip-users] netconn_recv blocked
Date: Thu, 20 Dec 2007 11:56:23 -0500

Hi, all:

Within udp_input, there are codes:

...
/*callback*/
If (pcb->recv !=NULL)
{
        pcb->recv(pcb->recv_arg, pcb,p, &(iphdr->src), src);
}

What is the callback function for UDP? Where does it be define for the
callback function? How does it work? Can someone explain to me? Thanks.

Regards,

David

  

-----Original Message-----
From: Chien-Lung Wu 
Sent: Thursday, December 20, 2007 11:07 AM
To: 'Mailing list for lwIP users'
Subject: RE: [lwip-users] netconn_recv blocked

Hi, Jifl:

    Thank you so much for your help.

    I trace the DHCP_OFFER packet. It is up to upd_input() with src_port
67, and dest_port 68. What I don't understand is how such DHCP_OFFER
packet gos up (function1 -> function2-> ...-> netconn_recv())for
netconn_recv. Would you please give me some hints? Thanks.

Merry Christmas,

David 

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Jonathan Larmour
Sent: Tuesday, December 18, 2007 9:38 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] netconn_recv blocked

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


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users




reply via email to

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