0
votes

I want to open a basic socket by the below code:

SOCKET  s;
s=socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); 
if(s==INVALID_SOCKET || s == SOCKET_ERROR) {
        printf("%d", errno);
        closesocket(s);
        return SOCKET_INIT_FAILED;
}

The errno it returns: 93.

kernel Version: 2.6.18-238.el5 Cent OS: 5.7

3

3 Answers

0
votes

There are two types of SCTP sockets: a one-to-one socket and a one-to-many socket.To create SCTP socket you should specify:

  • one-to-one: AF_INET family, SOCK_STREAM type and IPPROTO_SCTP protoccol

  • one-to-many: AF_INET family, SOCK_SEQPACKET type and IPPROTO_SCTP protoccol

Since errno 93 is " Protocol not supported" then try with SOCK_SEQPACKET:

int sock_fd = Socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP);
0
votes

Problem lies in IPv6 configuration. SCTP protocol implementation needs IPv6 enabled. Once it is enabled, our program working.

0
votes

I think you should install lksctp, the error 93 is "Protocol not supported"