the return value of sctp_connectx do not match any error
Michael Tüxen
Michael.Tuexen at lurchi.franken.de
Mon Dec 5 12:00:22 UTC 2011
On Dec 5, 2011, at 4:10 AM, jyl_2006 wrote:
> 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".
This means that you are using a one-to-many style socket (SOCK_SEQPACKET)
and you provide an association identifier which does not belong
to any association (anymore).
>
> /*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 =
This is from the man page. In case of SCTP socket it seems to miss some
error codes...
> 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.
So which one is it? The man page seems to need some update.
Best regards
Michael
>
> 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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>
More information about the freebsd-net
mailing list