Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3605138
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:05:11+00:00 2026-05-18T21:05:11+00:00

I am trying to create a socket of sctp and then retrieve the socket

  • 0

I am trying to create a socket of sctp and then retrieve the socket options information, using sctp_opt_info().

I am successfully able to create the specific socket however on socket option retrieval I am getting the value as -1 indication some error. The error is because of invalid arguments of sctp_opt_info().

Can some one please guide me what is wrong. Why am I getting -1 for this call and not 0(success indicator)

int socket_desc;
struct sockaddr_in  sin[1]; 
unsigned int len;
int val1,val2; 
char s[100]; 

struct sctp_rtoinfo {
    sctp_assoc_t    srto_assoc_id;
    uint32_t        srto_initial;
    uint32_t        srto_max; 
    uint32_t        srto_min;
}rto;


socket_desc=socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP);
if (socket_desc==-1)
  printf("Socket Fail");

val1 = sctp_opt_info(socket_desc,IPPROTO_SCTP,SCTP_RTOINFO,&rto,&len);

printf("Erro : %d, \n", errno );
perror(s);
printf("Status opt info: %d\n",val1);

I am getting the val1 value as -1 indicating some problem. The perror says invalid argument for sctp_opt_info(). My guess is argument two of this function , not sure though.

Any help will be appreciated.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:05:12+00:00Added an answer on May 18, 2026 at 9:05 pm

    len, the last parameter to sctp_opt_info() is a value-result parameter. You have to atleast initialize it to the length of the parameter you pass in,

    len = sizeof rto;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create my own subclass of socket.socket that will be able to
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
I'm trying to create a sitemap using Linq to Xml, but am getting an
I'm trying to create a webapplication where I want to be able to plug-in
I'm trying to create a simple WebSocket example using the HTML5/JS API. Based on
I am trying to create a Socket Hello World program. I would ideally like
I'm trying to create a windows driver that allows a standard TCP/IP socket to
Trying to create an app that does some socket communication (Writing only). I can
I am trying to write a simple IO::Socket connection in perl. However, I am
I am trying to Create a simple Tcp Server in C++ using Boost ASio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.