All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent LEQUIEVRE <laurent.lequievre@gmail.com>
To: "xenomai@xenomai.org" <xenomai@xenomai.org>, laurent.lequievre@gmail.com
Subject: [Xenomai] need help to Xenomai Cobalt RTnet socket UDP recvfrom non blocking
Date: Fri, 17 Jun 2016 11:55:20 +0200	[thread overview]
Message-ID: <5763C908.6010007@gmail.com> (raw)

Hello,

I installed xenomai 3.0.2 and try to test some RTnet features needed for 
the communication with my Kuka robot arm.

I specify that I want to work with the skin posix only.

I need to create a UDP socket with a timeout on the 'recvfrom' function 
(Non blocking recvfrom).

I tested this first code :

int udp_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
bind(udp_socket, ...)
struct timeval timeout;
timeout.tv_sec = 1;
timeout.tv_usec = 0;

setsockopt(udp_socket, SOL_SOCKET, SOCKET_SO_RCVTIMEO, &timeout, 
sizeof(timeout));
--> this function return -1, errno=92, Protocol not available ???
....
recvfrom(udp_socket, ....) --> blocked ??

I tested this second code :

int udp_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
bind(udp_socket, ...)
fcntl(udp_socket, F_SETFL, O_NONBLOCK);
--> this function return 0
....
recvfrom(udp_socket, ....) --> blocked ??

Can you give me a sample ?

Thanks for your help,

Regards,

Laurent LEQUIEVRE







             reply	other threads:[~2016-06-17  9:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  9:55 Laurent LEQUIEVRE [this message]
2016-06-17 10:07 ` [Xenomai] need help to Xenomai Cobalt RTnet socket UDP recvfrom non blocking Gilles Chanteperdrix
2016-06-17 10:21   ` Gilles Chanteperdrix
2016-06-17 11:28   ` Laurent LEQUIEVRE
2016-06-17 13:04     ` laurent LEQUIEVRE
2016-06-19  6:45       ` 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=5763C908.6010007@gmail.com \
    --to=laurent.lequievre@gmail.com \
    --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.