Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dammit!!! The InetAddress class was not corrected...

1 view
Skip to first unread message

Juliano Junio Viana

unread,
Dec 11, 1996, 3:00:00 AM12/11/96
to

Well...I was looking in the JDK 1.1 documentation, and I was pleased
until I found the java.net package.

After months the bug was related, the InetAddress class still don愒 have
a public constructor - you cannotconnect to an internet address if it愀
not ins the DNS space.

*Sigh*...I am trying to think that Sun愀 engineers have a good reason to
not correct it, but it愀 hard to see a good reason.

Juliano.

Stephen Pietrowicz

unread,
Dec 11, 1996, 3:00:00 AM12/11/96
to

Juliano Junio Viana (j...@dcc.ufmg.br) wrote:

: Well...I was looking in the JDK 1.1 documentation, and I was pleased


: until I found the java.net package.

: After months the bug was related, the InetAddress class still don´t have
: a public constructor - you cannotconnect to an internet address if it´s
: not ins the DNS space.

: *Sigh*...I am trying to think that Sun´s engineers have a good reason to
: not correct it, but it´s hard to see a good reason.

: Juliano.

What were you trying to do exactly? There was a bug that if you did:

InetAddress addr = InetAddress.getByName("1.2.3.4");

it would throw an Exception. That has been fixed in 1.1

srp


--
s...@ncsa.uiuc.edua - Member of the Habanero Group
Habanero Home Page http://www.ncsa.uiuc.edu/SDG/Software/Habanero/
Java Books Page http://lightyear.ncsa.uiuc.edu/~srp/java/javabooks.html

David Brown

unread,
Dec 12, 1996, 3:00:00 AM12/12/96
to

Hi,

The class doesn't have a public constructor for security
reasons, and you don't really need one anyway: the bug in 1.0.2 you're
referring to, that you couldn't create an InetAddress if the
host had no DNS entry, has been fixed in 1.1. You can always
construct one from an IP string like: "%d.%d.%d.%d". For an
IP address, internally, no reverse DNS lookup for the hostname
happens anymore, until the hostname is asked for by InetAddress.getHostName().
Even then, if one isn't found, "%d.%d.%d.%d" is returned. So
you can create any valid InetAddress in this fashion regardless of
DNS.

-Dave Brown

---------IATest.java-----------------------

import java.net.InetAddress;

class IATest {

static void p(String s) {
System.err.println(s);
}

public static void main(String args[]) throws Exception {
InetAddress in = null;
for(int i = 0; i < args.length; i++) {
String host = args[i];
p("Make InetAddress out of " + host + ":");
in = InetAddress.getByName(host);
p("got hostname/addr " + in);
}
}
}

In article <58mt7l$k...@caribe.skynet.com.br>,


Juliano Junio Viana <j...@dcc.ufmg.br> wrote:
>
>Well...I was looking in the JDK 1.1 documentation, and I was pleased
>until I found the java.net package.
>

>After months the bug was related, the InetAddress class still don愒 have
>a public constructor - you cannotconnect to an internet address if it愀


>not ins the DNS space.
>

>*Sigh*...I am trying to think that Sun愀 engineers have a good reason to
>not correct it, but it愀 hard to see a good reason.
>
> Juliano.
>
>

0 new messages