Date: Mon, 5 Dec 2011 13:00:18 +0100 From: =?iso-8859-1?Q?Michael_T=FCxen?= <Michael.Tuexen@lurchi.franken.de> To: jyl_2006 <yilinjing2006@gmail.com> Cc: freebsd-net@freebsd.org Subject: Re: the return value of sctp_connectx do not match any error Message-ID: <C5C720EB-1EA7-432A-B34E-3BD558C9BC4F@lurchi.franken.de> In-Reply-To: <1323054646502-5047743.post@n5.nabble.com> References: <1322919283456-5044536.post@n5.nabble.com> <76108404-D722-48D0-AAAA-F35B77F5CFCF@lurchi.franken.de> <1322966561294-5045598.post@n5.nabble.com> <F9593CD9-520A-49D4-9093-7DA02DDEE521@lurchi.franken.de> <1323000072198-5046113.post@n5.nabble.com> <ED9B11CB-4442-44C2-86EC-A2F7AC86C8E4@lurchi.franken.de> <1323001847851-5046165.post@n5.nabble.com> <3E25BC69-1FC8-487E-BBAD-8BAF2552623B@lurchi.franken.de> <1323004488998-5046216.post@n5.nabble.com> <F2E9EABF-175E-418C-8E52-0DDF4BF483F0@lurchi.franken.de> <1323054646502-5047743.post@n5.nabble.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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). >=20 > /*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*/ >=20 > if (getsockopt(_sctp_socket, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, = addrs, > &siz) !=3D 0) {=20 > perror("SCTP_GET_LOCAL_ADDRESSES");=20 > return (-1);=20 > }=20 > printf("siz =3D %u.\n", siz); >=20 > 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 =3D 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 >=20 > Thanks. >=20 > -- > 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-unsubscribe@freebsd.org" >=20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C5C720EB-1EA7-432A-B34E-3BD558C9BC4F>