lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] netconn_recv blocked


From: Chien-Lung Wu
Subject: [lwip-users] netconn_recv blocked
Date: Tue, 18 Dec 2007 14:20:45 -0500

Hi, all:

  I created client program (DHCP client) using UDP:

  1. Create socket/connection:

     Conn = netconn_new(NETCONN_UDP)

  2. connect to remote:
     
     Netconn_connect(conn, IP_ADDR_BROADCAST, DHCP_SERVER_PORT);

  3. Bind to local port

     Netconn_bind(conn, IP_ADDR_ANY, DHCP_CLIENT_PORT)



  4. Prepare message for sending DHCP request (DHCP discover)

  5. I am able to send out the correct message (DHCPDISCOVER) for DHCP 
     Server.

  6. From network, I am able to monitor the packets (Ethereal)
     So the DHCP client send out (DHCPDISCOVE) for DHCP server, 
     And DHCP server responses this request and send a DHCPOFFER for
client.

  7. I used:
     Netconn_recv(conn) to receive the DHCPOFFER packet; 
     However, it seems to me that netconn_recv(conn) was blocked and
seem 
     That client doesn't receive such packet!


  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);)

     Q2. The netconn_recv(conn) seems been blocked!
         Are there any ways to have timeout mechanism to unblock the
process 
         After certain time?

Thanks for your help.


Regards,

Chien-Lung
  






reply via email to

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