Networking Forums

Networking Forums > Computer Networking > Linux Networking > Cannot bind name to socket! : Address already in use

Reply
Thread Tools Display Modes

Cannot bind name to socket! : Address already in use

 
 
Ravi
Guest
Posts: n/a

 
      12-01-2003, 01:39 PM
I get this error when I run my program a second time
Is there a way to prevent this?

(I always close any open sockets)

TIA.


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
 
Reply With Quote
 
 
 
 
Frank A. Uepping
Guest
Posts: n/a

 
      12-01-2003, 04:52 PM
Ravi wrote:

> I get this error when I run my program a second time
> Is there a way to prevent this?
>
> (I always close any open sockets)
>
> TIA.
>
>

Set the flag SO_REUSEADDR.
setsockopt(..., SOL_SOCKET, SO_REUSEADDR, ..., ...);
Look at the man page to setsockopt() call for more info.

/FAU



 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
user mode permission denied to bind to socket hieswarmcaquest Linux Networking 0 05-03-2011 04:35 PM
strange behavior when the client bind its UDP socket to a local address Christophe Lohr Linux Networking 14 01-23-2009 01:03 PM
connection refused trying to bind AF_INET to AF_NETLINK/NETFILTER socket ssussman@starentnetworks.com Linux Networking 0 05-14-2007 06:52 PM
detecting tcp/udp socket bind in kernel module hari_kannan@hotmail.com Linux Networking 0 03-21-2007 05:34 PM
exim4 socket bind() failed as single installed MTA Olaf Petzold Linux Networking 4 09-03-2006 09:44 AM



1 2 3 4 5 6 7 8 9 10 11