[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why cannot bind to someipaddress:port when something else has *:port bound?



On Fri, 1 Jun 2001 horape@tinuviel.compendium.net.ar wrote:

> ¡Hola!
> 
> The following program binds *:1000 to a socket, and then tries to bind
> 200.47.36.254:1000 to another socket, the error i gets is "Address
> already in use". Why?

Because when you use INADDR_ANY, you bind to port 1000 on all 
addresses on the box.  That's why the second fails.  Technically, your
already bound to 200.47.36.254:1000, which is why your explict binding
fails.

--
Joseph