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:
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
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.
Log in to post a comment.