Skip to contentSkip to conversation

Sending UDP messages from xenomai context

Xenomai Schmeits Cedric (DC-AE/EHP2) 1 participant 1 message Nov 8, 2017

lore
Share & tools
lore
#0 lore raw

Hello,

I'm in the need of sending out an UDP package after calculations done within the context of a xenomai thread. Currently the sending is done, but the thread is migrated to the linux domain.

Currently i'm using the following setup to send out the packages:

	int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
	struct sockaddr_in  addr;
    	memset((char *) &addr, 0, sizeof(addr));
	addr.sin_family = AF_INET;
	addr.sin_port = htons(5678);
	....
	int ret = sendto(s, pBuffer, bufferSize, 0, (struct sockaddr*)&addr, sizeof(addr));

Slackspot is telling me the following:
#3 0x0000000000013a68 __real_sendto() in [/usr/xenomai/lib/libcobalt.so.2.0.0] #4 0x00000000000111d2 __cobalt_sendto() in [/usr/xenomai/lib/libcobalt.so.2.0.0]

So mine question is, is there a way of sending out the UDP message and without migrating to the linux domain? One possibility I came up with, until now, is to have an additional thread running in the linux domain that handles the communication, but that will cause extra undeterministic delay, which I would like to prevent.

I know that there is RTnet, but the receiving side does not have the possibility to implement this.

Best regards,

Cedric Schmeits