#6 NBIO Sockets return NULL remote address under Java 1.4

open
nobody
NBIO (3)
5
2003-07-22
2003-07-22
Anonymous
No

Under Java 1.4.x, NBIO sockets always return a NULL
remote IP address. This appears to be a problem
stemming from issues involving the addition of
Inet4Address and Inet6Address classes in Java 1.4.
(This behaviour is confirmed by others in this archived
mailing list post:
https://sourceforge.net/mailarchive/forum.php?thread_id=1704130&forum_id=10144\)

As noted by "Zsombor Gegesy", the bug can be fixed by
modifying nbio.c to instantiate Inet4Address objects
instead of InetAddress. Specifically, there are two
lines which need to be changed. Locate the two lines
which are:

cls = (*env)->FindClass(env, "java/net/InetAddress");

and change them both to:

cls = (*env)->FindClass(env, "java/net/Inet4Address");

In the current build, these are located at line numbers
582 and 874.

IMHO, a permanent solution should be incorporated into
the source to resolve this, possibly via a simple
config option, or automatically testing for what
version of Java is being used.

Brian

bcairns@itpwebsolutions.com

Discussion


Log in to post a comment.