struct addrinfo hint, *result;
int res, sfd;
memset(&hint, 0, sizeof(struct addrinfo));
hint.ai_family = AF_INET;
hint.ai_socktype = SOCK_STREAM;
res = getaddrinfo(NULL, port, &hint, &result);
I think getaddrinfo
should return two addrinfo when using 'SOCK_STREAM'. One protocol is tcp
, the other protocol is sctp
. However, getaddrinfo
only return tcp
protocol. I don't know why ?
I use ubuntu 14.04, linux kernel 3.19.0 and install sctp
protocol by typing: apt-get install libsctp-dev