Hi,
I've tried with this code
"server"
----------------------------------
if (argc == 2) {
local_addr.sin_family = AF_INET;
local_addr.sin_addr.s_addr = INADDR_ANY;
local_addr.sin_port = htons(atoi(argv[1]));
} else {
fprintf(stderr,
"Usage: "
"%s <local-port>\n",
argv[0]);
exit(1);
}
mlockall(MCL_CURRENT|MCL_FUTURE);
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
ret = bind(sockfd, (struct sockaddr *) &local_addr,sizeof(struct
sockaddr_in));
ret = recv(sockfd, &msg, sizeof(msg), 0);
close(sockfd);
printf("Received message: port %d owner %llu hard %d size=%d\n",msg.port,
msg.owner,msg.hard,ret);
----------------------------------
"client"
----------------------------------
if (argc == 4) {
local_addr.sin_family = AF_INET;
local_addr.sin_addr.s_addr = INADDR_ANY;
local_addr.sin_port = htons(atoi(argv[1]));
server_addr.sin_family = AF_INET;
inet_aton(argv[2], &server_addr.sin_addr);
server_addr.sin_port = htons(atoi(argv[3]));
} else {
fprintf(stderr,
"Usage: "
"%s <local-port> "
"<server-ip> <server-port>\n",
argv[0]);
exit(1);
}
mlockall(MCL_CURRENT|MCL_FUTURE);
sockfd = rt_dev_socket(AF_INET, SOCK_DGRAM, 0);
lxrtnettsk = rt_task_init(4800, 1, 0, 0);
rt_make_hard_real_time();
ret = rt_dev_bind(sockfd, (struct sockaddr *) &local_addr, sizeof(struct
sockaddr_in));
rt_dev_connect(sockfd, (struct sockaddr *) &server_addr, sizeof(struct
sockaddr_in));
rt_dev_send(sockfd, &msg, sizeof(msg), 0);
rt_make_soft_real_time();
rt_dev_close(sockfd);
rt_task_delete(lxrtnettsk);
----------------------------------
if I try with linux server & linux client it works, the same with rtnet but
this example doesn't work.
Is a misconfiguration problem of the two nodes, code's error or something
else?
Thank's
Emanuele
2006/11/20, Jan Kiszka <[EMAIL PROTECTED]>:
Emanuele Clerici wrote:
> ok if I understand the previuos thread the way is by creating a
borderline
> thread it's ok?
Again, only for such a scenario:
Node A Node B
RT RT <=> Non-RT
| | |
RTnet <--> RTnet Linux
>
> but in previous thread we speak about a rtnet send and linux receive, in
> the other way (sending linux socket and receiving rtnet) is the same?
As I said, this is feasible as well (and then, of course, in both
directions):
Node A Node B
RT Non-RT
| |
RTnet <--> Linux
>
> I'm not sure of understanding your reply, there is a way to send an
rtnet
> packet from an rtnet socket on machine A to a linux socket on machine B
>
Read my very first reply:
http://www.mail-archive.com/rtnet-users%40lists.sourceforge.net/msg01456.html
Jan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
RTnet-users mailing list
RTnet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rtnet-users