- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everybody,
I am using lwip with uc/os ii and the socket api to establish an udp connection. During program execution it might happen, that the pbuf fills up. Trying to empty it, I have recognized that recvfrom() blocks even though I am using the flag MSG_DONTWAIT. Using select() to see if data is pending or lwip_ioctl() to check how many bytes are available will not work. My only explanation for this behavior would be that even though no more data can be stored in pbuf, rcvevent and recv_avail are incremented, and therefore recvfrom(), select and lwip_ioctl() are awaiting pbuf to hold mor data than there is available. Any ideas for a work around? --wolfLink Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
found out that this problem only occurs if the number of pbuffer is greater than 10.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi pfab,
you should also use pbuf_free(nameOfPbuf); else you run out of pbufs.... cheers, Danny- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, yes I do run out of pbufs, but that is not the point here, because a call to recvfrom() will release the pbuf it just read from.
The point is, that if I ran out of pbufs (wich is intended) and start reading/releasing them with recvfrom(), the function will block after getting about ten data packages, even though it is used in non blocking mode. Both select() and lwip_ioctl() indicate that there is data left, what is absolutely understandable, because more than ten pbufs are specified in the projects properties. Now I would like to know if this could be a bug in lwip or if I have to adjust some of the lwip properties (currently I am using the default values) or if there is any other plausible explanation for this behavior. Thanks in advance for all helpful info you can give! --wolf
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page