lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] recv callback function for sockets?


From: Mathias Zenger
Subject: [lwip-users] recv callback function for sockets?
Date: Tue, 28 Apr 2009 13:48:59 +0200

Hi,

I am using lwIP in context with FreeRTOS and try to write a NTP client. I
have a task which is called fix every 1000 ms. In the task loop I either
send out a UDP request to a NTP server or poll recvfrom() for received UDP
replies. For communication I am using the socket API.

My problem is that I should process the received packets immediately.
Polling recvfrom() every second is too slow. I am wondering if it's possible
to register a callback function which will be called as soon a packet was
received -> similar to udp_recv(). How would I have to use it with sockets??

Thanks for helping! Best regards,
Mathias


Additional information:

- My socket is non-blocking: lwip_ioctl(fd, FIONBIO, &noblock_true);
- Sending out my request datagram works fine: sendto(fd, &snd_buffer,
sizeof(snd_buffer), 0, (struct sockaddr *)&addr, addr_length);
- Reception basically works fine too: recvfrom(fd, &rec_buffer,
sizeof(rec_buffer), 0, (struct sockaddr *)&addr, &addr_length);






reply via email to

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