[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] recv callback function for sockets?
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-users] recv callback function for sockets? |
Date: |
Tue, 28 Apr 2009 14:26:37 +0200 |
I know it sounds repellent, but get a good book on sockets programming and read
about the function 'select()'.
Simon
> 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);
>
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen:
http://www.gmx.net/de/go/multimessenger01