NetBSD-Users archive

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

Re: network adapters, IP addresses, ports, domain names



steve%prd.co.uk@localhost (Steve Blinkhorn) writes:

> So can two different IP addresses on the same adapter each use the same
> port number each for its own distinct purposes?

It's not that IP addresses use ports.  It's that one progam can have a
listening socket bound to addra:p and another can bind to addrb:p.  As
far as I know, the logic in bind does not care if addra and addrb are
assigned to the same interface.  (It's not 'adaptor' as there could be
vlan interfaces on it, and there could be gif, tap, and so on.)

See also SO_REUSEADDDR, but I think you don't want to there.   You have
declined to explain your problem so I'll stop, but many problems like
this are from one program binding to *:p and then the other one can't.
Again, fstat -n is the way to see what is going on.



> I would assume they can since I run different web servers that use
> ports 80 and 443 in this way.

ports and addresses are not necessarily exactly parallel in general.


Home | Main Index | Thread Index | Old Index