setsockopt in windows

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • asit

    setsockopt in windows

    In my code I have to convert the following UNIX code to its winsock
    equivalent code...

    if(setsockopt(s ockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) ==
    -1)
    {
    perror("setsock opt error");
    }

    In the above code perror is not an issue. But how to fix setsockopt()
    function !!!!!
  • Ian Collins

    #2
    Re: setsockopt in windows

    asit wrote:
    In my code I have to convert the following UNIX code to its winsock
    equivalent code...
    >
    if(setsockopt(s ockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) ==
    -1)
    {
    perror("setsock opt error");
    }
    >
    In the above code perror is not an issue. But how to fix setsockopt()
    function !!!!!
    Have you tried searching for "setsockopt winsock"?

    Failing that, a windows programming group would be a good place to ask.

    --
    Ian Collins.

    Comment

    • CBFalconer

      #3
      Re: setsockopt in windows

      asit wrote:
      >
      In my code I have to convert the following UNIX code to its winsock
      equivalent code...
      >
      if(setsockopt(s ockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int))
      == -1)
      {
      perror("setsock opt error");
      }
      >
      In the above code perror is not an issue. But how to fix setsockopt()
      function !!!!!
      There is no such function in standard C. This is off-topic on
      c.l.c. Find a newsgroup that deals with your system, which appears
      to be Windows. The result will not be portable.

      --
      [mail]: Chuck F (cbfalconer at maineline dot net)
      [page]: <http://cbfalconer.home .att.net>
      Try the download section.

      Comment

      • Ian Collins

        #4
        Re: setsockopt in windows

        CBFalconer wrote:
        asit wrote:
        >In my code I have to convert the following UNIX code to its winsock
        >equivalent code...
        >>
        >if(setsockopt( sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int))
        >== -1)
        >{
        > perror("setsock opt error");
        >}
        >>
        >In the above code perror is not an issue. But how to fix setsockopt()
        >function !!!!!
        >
        There is no such function in standard C. This is off-topic on
        c.l.c. Find a newsgroup that deals with your system, which appears
        to be Windows. The result will not be portable.
        >
        Didn't I say that (in a more friendly manner) over 12 hours ago?

        --
        Ian Collins.

        Comment

        • Antoninus Twink

          #5
          Re: setsockopt in windows

          On 6 Oct 2008 at 21:44, Ian Collins wrote:
          CBFalconer wrote:
          [the usual]
          Didn't I say that (in a more friendly manner) over 12 hours ago?
          Since when did that ever stop CBF making a nuisance of himself?

          Comment

          • CBFalconer

            #6
            Re: setsockopt in windows

            Ian Collins wrote:
            CBFalconer wrote:
            >asit wrote:
            >>
            >>In my code I have to convert the following UNIX code to its
            >>winsock equivalent code...
            >>>
            >>if(setsockopt (sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int))
            >> == -1)
            >>{
            >> perror("setsock opt error");
            >>}
            >>>
            >>In the above code perror is not an issue. But how to fix
            >>setsockopt( ) function !!!!!
            >>
            >There is no such function in standard C. This is off-topic on
            >c.l.c. Find a newsgroup that deals with your system, which appears
            >to be Windows. The result will not be portable.
            >
            Didn't I say that (in a more friendly manner) over 12 hours ago?
            Yes, but not on my screen before I read and answered. Besides,
            your answer left topicality somewhat in doubt (IMO).

            --
            [mail]: Chuck F (cbfalconer at maineline dot net)
            [page]: <http://cbfalconer.home .att.net>
            Try the download section.

            Comment

            • Ian Collins

              #7
              Re: setsockopt in windows

              CBFalconer wrote:
              Ian Collins wrote:
              >Didn't I say that (in a more friendly manner) over 12 hours ago?
              >
              Yes, but not on my screen before I read and answered. Besides,
              your answer left topicality somewhat in doubt (IMO).
              >
              You could save your self a lot of time by reading ahead before replying.
              A threading newsreader would also help.

              --
              Ian Collins.

              Comment

              • Peter Nilsson

                #8
                Re: setsockopt in windows

                Ian Collins <ian-n...@hotmail.co mwrote:
                CBFalconer wrote:
                There is no such function in standard C. ...
                >
                Didn't I say that ... over 12 hours ago?
                Not the first bit, no.

                --
                Peter

                Comment

                Working...