All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] need help to Xenomai Cobalt RTnet socket UDP recvfrom non blocking
@ 2016-06-17  9:55 Laurent LEQUIEVRE
  2016-06-17 10:07 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: Laurent LEQUIEVRE @ 2016-06-17  9:55 UTC (permalink / raw)
  To: xenomai@xenomai.org, laurent.lequievre

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







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

end of thread, other threads:[~2016-06-19  6:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-17  9:55 [Xenomai] need help to Xenomai Cobalt RTnet socket UDP recvfrom non blocking Laurent LEQUIEVRE
2016-06-17 10:07 ` 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

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.