472,119 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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 5442
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.