I'm sorry for posting twice but I think that my problem became easier
to solve, because now I'm trying to convert both "linux_client.c" and
"linux_server.c" (located in /rtnet-0.9.12/examples/generic/) and it's
returning the same error: recvfrom(): Success

I simply changed socket() to rt_dev_socket(), bind() to rt_dev_bind(),
sendto() to rt_dev_sendto(), recvfrom() to rt_dev_recvfrom() etc
beyond adding "#include <rtdm/rtdm.h>" to the source files.

What I'm doing wrong?

Thanks again,
Leandro Favarin


On Wed, Jul 21, 2010 at 3:16 PM, Leandro Favarin
<leandro.fava...@phiinnovations.com> wrote:
> On Tue, Jul 20, 2010 at 3:21 AM, Jan Kiszka <jan.kis...@web.de> wrote:
>> Leandro Favarin wrote:
>>> Hi all,
>>>
>>> I have two executable files that communicate with each other through
>>> sockets (UDP), both running in the same machine.
>>> In the first scenario I made one executable (let's call him client)
>>> that generates float values to send to the other (let's call him
>>> server), and it's working perfectly.
>>> Now I'm modifying my code to use real-time environment, but I'm stuck
>>> with the error that rt_dev_recvfrom returns (-1).
>>> I also tested with errno and it returned 0.
>>
>> Also according to the docs, rt_dev_* returns the error directly. So -1
>> means -EPERM, and that indicates you are calling it over a non-RT task.
>>
>
> Hi Jan,
> Thanks for helping me.
> I run a few tests here and discovered that the return value of rt_dev_socket
> is 0. How is it possible? And what it means? (because in docs the possible
> return value is positive or negative when an error occurs.)
> Am I missing something?
>
>>>
>>> My system:
>>> Ubuntu 9.04 (kernel 2.6.30)
>>> Xenomai 2.4.9.1
>>> RTNet 0.9.12
>>
>> These are outdated versions. You may face bugs that have been fixed in
>> latest releases in the meantime.
>>
>> Jan
>>
>
> I know, but I have a few restrictions that I need to follow.
>
> Leandro Favarin
>
>>>
>>> Modules loaded:
>>> ~$ lsmod | grep rt
>>> rt_via_rhine           18544  1
>>> rtudp                  10148  0
>>> rt_loopback             2744  1
>>> rtpacket                6356  0
>>> rtipv4                 25832  1 rtudp
>>> rtnet                  41864  5 
>>> rt_via_rhine,rtudp,rt_loopback,rtpacket,rtipv4
>>> exportfs                4364  1 nfsd
>>> iTCO_vendor_support     3600  1 iTCO_wdt
>>> parport_pc             32420  1
>>> parport                35052  3 lp,ppdev,parport_pc
>>> agpgart                35052  3 drm,intel_agp
>>>
>>>
>>> Thanks,
>>> Leandro Favarin
>>
>>
>>
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
RTnet-users mailing list
RTnet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rtnet-users

Reply via email to