0

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

Saikat Biswas
  • 114
  • 1
  • 9

3 Answers3

0

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);
4pie0
  • 29,204
  • 9
  • 82
  • 118
0

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

Saikat Biswas
  • 114
  • 1
  • 9
0

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