All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] socket XDDP recvfrom timeout ?
@ 2016-06-24 14:35 Laurent LEQUIEVRE
  2016-06-24 14:37 ` Laurent LEQUIEVRE
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent LEQUIEVRE @ 2016-06-24 14:35 UTC (permalink / raw)
  To: xenomai, Laurent LEQUIEVRE

Hello,

I try to use the socket XDDP with the posix skin to communicate from RT 
thread to non RT thread.

To get a non blocked 'recvfrom', I added the flag 'MSG_DONTWAIT', and 
it's work fine.

But how to setup a timeout for this function ?

I tried to set the flag 'SO_RCVTIEMO' by using 2 methods :

struct timeval tv;
tv.tv_sec=nb seconds
tv.tv_usec=nb micro seconds
setsockopt(socket_id,SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); --> 
doesn't work, blocked !

timeout (in nano seonds)
ioctl(socket_id, SO_RCVTIMEO, &timeout);  --> doesn't work, blocked !


Thanks for your help,

Laurent LEQUIEVRE





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

* Re: [Xenomai] socket XDDP recvfrom timeout ?
  2016-06-24 14:35 [Xenomai] socket XDDP recvfrom timeout ? Laurent LEQUIEVRE
@ 2016-06-24 14:37 ` Laurent LEQUIEVRE
  2016-06-24 15:36   ` Gilles Chanteperdrix
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent LEQUIEVRE @ 2016-06-24 14:37 UTC (permalink / raw)
  To: xenomai, Laurent LEQUIEVRE

forgot to specify : Xenomai 3.0.2

Le 24/06/2016 16:35, Laurent LEQUIEVRE a écrit :
> Hello,
>
> I try to use the socket XDDP with the posix skin to communicate from 
> RT thread to non RT thread.
>
> To get a non blocked 'recvfrom', I added the flag 'MSG_DONTWAIT', and 
> it's work fine.
>
> But how to setup a timeout for this function ?
>
> I tried to set the flag 'SO_RCVTIEMO' by using 2 methods :
>
> struct timeval tv;
> tv.tv_sec=nb seconds
> tv.tv_usec=nb micro seconds
> setsockopt(socket_id,SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); --> 
> doesn't work, blocked !
>
> timeout (in nano seonds)
> ioctl(socket_id, SO_RCVTIMEO, &timeout);  --> doesn't work, blocked !
>
>
> Thanks for your help,
>
> Laurent LEQUIEVRE
>
>
>



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

* Re: [Xenomai] socket XDDP recvfrom timeout ?
  2016-06-24 14:37 ` Laurent LEQUIEVRE
@ 2016-06-24 15:36   ` Gilles Chanteperdrix
  0 siblings, 0 replies; 3+ messages in thread
From: Gilles Chanteperdrix @ 2016-06-24 15:36 UTC (permalink / raw)
  To: Laurent LEQUIEVRE; +Cc: Laurent LEQUIEVRE, xenomai

On Fri, Jun 24, 2016 at 04:37:12PM +0200, Laurent LEQUIEVRE wrote:
> forgot to specify : Xenomai 3.0.2

Just a simple reminder. The Xenomai mailing list is a "subscriber
only" mailing list. Which means you must be subscribed to be allowed
to post. And when I say you, I mean "one e-mail address". So, if you
want to use a second mail address, you must subscribe this second
mail address (and disable mail delivery if you do not want to
receive the e-mails twice).
-- 
					    Gilles.
https://click-hack.org


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

end of thread, other threads:[~2016-06-24 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-24 14:35 [Xenomai] socket XDDP recvfrom timeout ? Laurent LEQUIEVRE
2016-06-24 14:37 ` Laurent LEQUIEVRE
2016-06-24 15:36   ` Gilles Chanteperdrix

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.