All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent LEQUIEVRE <laurent.lequievre@gmail.com>
To: xenomai@xenomai.org,
	Laurent LEQUIEVRE <laurent.lequievre@univ-bpclermont.fr>
Subject: [Xenomai] socket XDDP recvfrom timeout ?
Date: Fri, 24 Jun 2016 16:35:43 +0200	[thread overview]
Message-ID: <576D453F.4090208@gmail.com> (raw)

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





             reply	other threads:[~2016-06-24 14:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 14:35 Laurent LEQUIEVRE [this message]
2016-06-24 14:37 ` [Xenomai] socket XDDP recvfrom timeout ? Laurent LEQUIEVRE
2016-06-24 15:36   ` Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=576D453F.4090208@gmail.com \
    --to=laurent.lequievre@gmail.com \
    --cc=laurent.lequievre@univ-bpclermont.fr \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.