why there is still bind error:address already in use
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > why there is still bind error:address already in use




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    why there is still bind error:address already in use  
zhengda


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-21-04 04:35 PM

i write a program with socket.
and i have used the function setsockopt(listenfd , SOL_SOCKET , SO_REUSEADDR
, &opt , sizeof(opt)),
but there is still an error "bind error:address already in use"
why?







[ Post a follow-up to this message ]



    Re: why there is still bind error:address already in use  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-21-04 04:35 PM

In article <c661sj$3uj$2@mail.cn99.com>,
"zhengda" <zhengda1936@sina.com> wrote:

> i write a program with socket.
> and i have used the function setsockopt(listenfd , SOL_SOCKET , SO_REUSEAD
DR
> , &opt , sizeof(opt)),
> but there is still an error "bind error:address already in use"
> why?

Show us some more code.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***





[ Post a follow-up to this message ]



    Re: why there is still bind error:address already in use  
David Schwartz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-21-04 05:34 PM


"zhengda" <zhengda1936@sina.com> wrote in message
news:c661sj$3uj$2@mail.cn99.com...

>i write a program with socket.
> and i have used the function setsockopt(listenfd , SOL_SOCKET ,
> SO_REUSEADDR
> , &opt , sizeof(opt)),
> but there is still an error "bind error:address already in use"
> why?

Because the address is in use?

DS







[ Post a follow-up to this message ]



    Re: why there is still bind error:address already in use  
joe@invalid.address


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-21-04 06:36 PM

"zhengda" <zhengda1936@sina.com> writes:

> i write a program with socket.  and i have used the function
> setsockopt(listenfd , SOL_SOCKET , SO_REUSEADDR , &opt ,
> sizeof(opt)), but there is still an error "bind error:address
> already in use" why?

Use netstat to see if the port is already bound by something else.

Joe
--
If people don't want to come out to the ballpark, nobody's going
to stop them.
- Yogi Berra





[ Post a follow-up to this message ]



    Re: why there is still bind error:address already in use  
John Galt


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-23-04 11:34 PM

"zhengda" <zhengda1936@sina.com> wrote in message news:<c661sj$3uj$2@mail.cn99.com>...[vbcol
=seagreen]
> i write a program with socket.
> and i have used the function setsockopt(listenfd , SOL_SOCKET , SO_REUSEAD
DR
> , &opt , sizeof(opt)),[/vbcol]


have you set the var 'opt' to the correct (positive) value?
Calling setsockopt() with opt = 0 is not effective.

-John





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:29 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register