All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Xddp protocol: question of one example
@ 2013-12-18 23:37 Leopold Palomo-Avellaneda
  2013-12-20 10:13 ` Philippe Gerum
  0 siblings, 1 reply; 4+ messages in thread
From: Leopold Palomo-Avellaneda @ 2013-12-18 23:37 UTC (permalink / raw)
  To: xenomai

Hi,

I'm developing an application that need (as always) interchange data between a realtime part and non-realtime.

Looking on the documentation and surfing on the web I have found interesting for my app the examples of xddp protocol. Some time ago, there was an interesting mail about it [1].

There, the original author ask one thing that I would like to be sure that I understood. On the examples, the realtime thread uses the function recvfrom() to receive data from the non-rt thread.

In the mail, the original author asked about make recvfrom 
call non-blocking in xddp context, and *Philippe Gerum* answered that 
MSG_DONTWAIT should be set in flags.

So, my question is that using that flag, some code like this:


/* Read back packets echoed by the regular thread */
ret = recvfrom(s, buf, sizeof(buf), 0, NULL, 0);
if(ret <= 0)
    fail("recvfrom");

recvfrom will not be blocked, but it will return 0?

May I understood that if there's data on the sockect recvfrom will
return something and if no, it would not be blocked and return something?

Thanks in advance,

Leopold

[1] http://www.xenomai.org/pipermail/xenomai/2010-February/019364.html

-- 
--
Linux User 152692     PGP: 0xF944807E
Catalonia
-------------------------------------
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-20 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-18 23:37 [Xenomai] Xddp protocol: question of one example Leopold Palomo-Avellaneda
2013-12-20 10:13 ` Philippe Gerum
2013-12-20 12:42   ` Leopold Palomo-Avellaneda
2013-12-20 14:49     ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.