469,332 Members | 6,612 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,332 developers. It's quick & easy.

setsockopt in windows

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("setsockopt error");
}

In the above code perror is not an issue. But how to fix setsockopt()
function !!!!!
Oct 6 '08 #1
7 5242
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("setsockopt 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.
Oct 6 '08 #2
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("setsockopt 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.
Oct 6 '08 #3
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("setsockopt 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.
Oct 6 '08 #4
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?

Oct 6 '08 #5
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("setsockopt 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.
Oct 6 '08 #6
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.
Oct 6 '08 #7
Ian Collins <ian-n...@hotmail.comwrote:
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
Oct 7 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Songling | last post: by
1 post views Thread by Scott Davies | last post: by
reply views Thread by Scott Davies | last post: by
4 posts views Thread by Rod Gill | last post: by
6 posts views Thread by asit | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.