- DU_LOG("\nSCTP: Binding failed at RIC");
- }
- else if((ret = sctpAccept(&ricParams.lstnSockFd, &ricParams.peerAddr, &ricParams.sockFd)) != ROK)
- {
- DU_LOG("\nSCTP: Unable to accept the connection at RIC");
+
+ if((ret = cmInetSocket(socket_type, &sctpCb.e2LstnSockFd, IPPROTO_SCTP) != ROK))
+ {
+ DU_LOG("\nERROR --> SCTP : Socket[%d] coudnt open for listening", sctpCb.e2LstnSockFd.fd);
+ }
+ else if((ret = cmInetSctpBindx(&sctpCb.e2LstnSockFd, &sctpCb.localAddrLst, sctpCb.sctpCfg.e2SctpPort)) != ROK)
+ {
+ DU_LOG("\nERROR --> SCTP: Binding failed at RIC");
+ }
+ else if(ret = cmInetListen(&sctpCb.e2LstnSockFd, 1) != ROK)
+ {
+ DU_LOG("\nERROR --> SCTP: Unable to accept the connection at CU");
+ DU_LOG("\nERROR --> SCTP : Listening on socket failed");
+ cmInetClose(&sctpCb.e2LstnSockFd);
+ 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 RIC");
+ }
+ }
+ }