Teresa Noviello wrote:
> Hi! I have modified rtt-sender.c and rtt-responder.c in the way you see in
> attachments, i use them in two different shells with the two commands (on
> the same machine):
>
> 1. ./rtt-sender -d 127.0.0.1
> 2. ./rtt-responder -l 127.0.0.1
>
> rtt-sender goes in Segmentation Fault and rtt-responder remains up. What i
> do wrong?
>
> I see in debug messages that sendto_rt in transmitter function doesnt't
> send
> anything! Why?
> the messages are:
>
> sendo failed - perror: Success.
This is due to the fact that sendto_rt is not the POSIX variant, it's
the native real-time interface (and its obsolete, new naming scheme:
rt_dev_sendto). Only the wrapped POSIX sendto would set errno correctly,
but I'm not up-to-date with the RTAI status here. So, try to catch the
result of sendto_rt directly and print that one.
The sendto_rt result is: 1
I have no idea of what does it mean.
PS: What is switch_errno?
A custom function i have written:
void switch_errno(int err){
printf("***switch_errno***\t");
switch(err){
case EBADF:
printf("is not a valid descriptor\n");
break;
case EFAULT:
printf("(third argument ) references an inaccessible memory area\n");
printf("An invalid user space address was specified for a parameter.\n");
break;
case ENOTTY:
printf("(first descriptor) is not associated with a character special device\n");
printf("The specified request does not apply to the kind of object that the descriptor"
"references\n");
break;
case EINVAL:
printf("Request or third argument is not valid\n");
printf("Unknown protocol, or protocol family not available.\n");
printf("Invalid argument passed.\n");
break;
/////sockets
case ECONNRESET:
printf("Connection reset by peer.\n");
break;
case EDESTADDRREQ:
printf("The socket is not connection-mode, and no peer address is set.\n");
break;
case EINTR:
printf("A signal occurred before any data was transmitted.\n");
break;
case EISCONN:
printf("The connection-mode socket was connected already but a recipient was"
"specified. (Now either this error is returned, or the recipient speci-"
"fication is ignored.\n");
break;
case EMSGSIZE:
printf("The socket type requires that message be sent atomically, and the size"
"of the message to be sent made this impossible.\n");
break;
case EPROTONOSUPPORT:
printf("The protocol type or the specified protocol is not supported within"
"this domain\n");
break;
case EAFNOSUPPORT:
printf("The implementation does not support the specified address family.\n");
break;
case ENFILE:
printf("Not enough kernel memory to allocate a new socket structure\n");
break;
case EMFILE:
printf("Process file table overflow\n");
break;
case EACCES:
printf(" Permission to create a socket of the specified type and/or protocol is"
"denied.\n");
break;
case ENOBUFS:
printf("The output queue for a network interface was full. This generally"
"indicates that the interface has stopped sending, but may be caused by"
"transient congestion. (Normally, this does not occur in Linux. Packets"
"are just silently dropped when a device queue overflows.\n");
case ENOMEM:
printf("Insufficient memory is available. The socket cannot be created until"
" sufficient resources are freed.\n");
break;
case EAGAIN:
//case EWOULDBLOCK:
//printf("Non ci sono messaggi ed il socket e' non-bloccante\n");
printf("The socket is marked non-blocking and the requested operation would"
"block.");
break;
case ENOTCONN:
printf("The socket is not connected, and no target has been given.\n");
case ENOTSOCK:
printf("The argument s is not a socket.\n");
case EOPNOTSUPP:
printf("Some bit in the flags argument is inappropriate for the socket type.\n");
case EPIPE:
printf("The local end has been shut down on a connection oriented socket. In"
"this case the process will also receive a SIGPIPE unless MSG_NOSIGNAL"
"is set.\n");
/////
default:
printf("(error) not recognized\n");
break;
}
}
-----------------------------------
--
Teresa Noviello
Chiedersi Sempre:"Avro' il tempo di rifarlo?"
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ RTnet-users mailing list RTnet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rtnet-users