Hi Chris!
On 3/25/18 6:37 AM, Chris Hegarty wrote:
On 23 Mar 2018, at 21:55, Chris Hegarty <chris.hega...@oracle.com
<mailto:chris.hega...@oracle.com>> wrote:
For reference, here's the combined webrev:
http://cr.openjdk.java.net/~igerasim/8198358/03/webrev/
<http://cr.openjdk.java.net/%7Eigerasim/8198358/03/webrev/>
I think this is good. And thanks for the additional test coverage,
this is great.
Actually, there is a couple of places in the new native code that
has the following pattern:
if (sa.sa.sa_family != AF_INET) {
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
"Protocol family not supported");
NET_SocketClose(newfd);
return -1;
}
I would like to remove the NET_SocketClose, and allow the
exception propagating at the Java-level be responsible for
closing the socket, which will then do so in cooperation
with the socket cleaner ( it will effectively cancel the cleaner ).
-Chris.
In the code above, newfd was obtained from a call to accept() a few
lines before this check.
So, the Java code has no way of being aware of this socket, and it will
never be closed unless we do it right here, before returning -1.
I checked the other places, where family is checked to be AF_INET and
can confirm there's no other places where a socket gets closed.
With kind regards,
Ivan
--
With kind regards,
Ivan Gerasimov