- DU_LOG("\nERROR --> SCTP: Binding failed at CU");
- }
- else if((ret = sctpAccept(&f1Params.lstnSockFd, &f1Params.peerAddr, &f1Params.sockFd)) != ROK)
- {
- DU_LOG("\nERROR --> SCTP: Unable to accept the connection at CU");
+ if((ret = cmInetSocket(socket_type, &sctpCb.f1LstnSockFd, IPPROTO_SCTP) != ROK))
+ {
+ DU_LOG("\nERROR --> SCTP : Socket[%d] coudnt open for listening", sctpCb.f1LstnSockFd.fd);
+ }
+ else if((ret = cmInetSctpBindx(&sctpCb.f1LstnSockFd, &sctpCb.localAddrLst, sctpCb.sctpCfg.f1SctpPort)) != ROK)
+ {
+ DU_LOG("\nERROR --> SCTP: Binding failed at CU");
+ }
+ else if(ret = cmInetListen(&sctpCb.f1LstnSockFd, 1) != ROK)
+ {
+ DU_LOG("\nERROR --> SCTP : Listening on socket failed");
+ cmInetClose(&sctpCb.f1LstnSockFd);
+ return RFAILED;
+ }
+ else
+ {
+ for(assocIdx=0; assocIdx < sctpCb.numAssoc; assocIdx++)
+ {
+ if((ret = sctpAccept(&sctpCb.assocCb[assocIdx])) != ROK)
+ {
+ DU_LOG("\nERROR --> SCTP: Unable to accept the connection at CU");
+ }
+ }
+ }