[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?
Joseph W. Shaw II wrote:
> > 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.
I think he meant why it is not possible to bind *:1000 to all other IP
adresses than the ones that are bound to some specific IP.
Sort of "catch all the rest" mechanism. But this makes no sense, since "*"
means "all", not "the rest".
--
1024D/DC805C44 2000-07-06 http://cran.ath.cx/~seb/publicpgpkey.asc
key fingerprint A079 88E9 3617 838D ED65 A7D1 277D D529 DC80 5C44