Bind to only specific IPv4 IP addresses

Hi,How can we restrict the IP binding to only IPv4 specific on a host which has different IP's.Example : Host 1IP Address : 1.1.1.1 - IPv4IP Address : asd.asdi8.0 - IPv6Hence allow binding only to 1.1.1.1.Thanks.
[269 byte] By [Rheaa] at [2007-11-26 18:40:34]
# 1

Read the socket API. Specifically the bind method and the connect method that uses four arguments.

This is, of course, something that needs to be done in the code everywhere it is used. There is nothing, AFAIK, that you can do "system" wide, besides maybe writing your own classes to extend Socket and SocketFactory that does this binding automatically.

masijade.a at 2007-7-9 6:14:35 > top of Java-index,Core,Core APIs...
# 2

Thanks masijade.

Currently, I am using createServerSocket(port, backlog, IP).

For which if IP is null then by default it binds to all ip address for that port on that machine.

I was wondering if there is an API which allows bind to only all IPv4 ip address on a host which has both IPv6 and IPv4 IP addresses.

Thanks.

Rheaa at 2007-7-9 6:14:35 > top of Java-index,Core,Core APIs...
# 3
Well give it an IPv4 address. Otherwise it will bind to *. You might try "0.0.0.0" and see if that essentially binds to "all IPv4 addresses" and not the IPv6, but I doubt it would work.
masijade.a at 2007-7-9 6:14:35 > top of Java-index,Core,Core APIs...