This time, the program you provide work perfectly.
But when I use another program to test, the result
is"SCTP_GET_LOCAL_ADDRESS:no such file or directory".

/*My own program have the same set with the program you provide, that means
the ip address is the same and both programs have same "Server to be
connected" .
The "siz" refered in the following code is different with the value I get
from my another program*/

 if (getsockopt(_sctp_socket, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, addrs,
&siz) != 0) { 
        perror("SCTP_GET_LOCAL_ADDRESSES"); 
        return (-1); 
 } 
        printf("siz = %u.\n", siz);

As far as I know, then getsockopt is fail, the return value is -1, and the
errno is set as one of following values 1.EBADF, 2.ENOTSOCK, 3.ENOPROTOOPT
4.EFAULT, 5.EINVAL . In my own program I use return_value =
getsockopt(_sctp_socket, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, addrs,
&siz), the value of return_value is -1, so it means an error happened and
errno will be set. A strange thing happens, the errno is not the values
refered above.

Thanks.

--
View this message in context: 
http://freebsd.1045724.n5.nabble.com/the-return-value-of-sctp-connectx-do-not-match-any-error-tp5041952p5047743.html
Sent from the freebsd-net mailing list archive at Nabble.com.
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to