RFR 8195059: Update java.net Socket and DatagramSocket implementations to use Cleaner
Roger Riggs
Roger.Riggs at Oracle.com
Tue Jan 30 22:08:49 UTC 2018
Please review changes to replace finalizers in socket, datagram, and
multicast networking
with Cleaner based release of the raw file descriptors. Each
FileDescriptor is registered
for cleanup after the raw fd (or handle) is assigned. Normal calls to
close unregister the
cleaner before using the current logic to close the raw fd/handle.
Windows networking
uses fd's with the Windows socket_ API requiring a special cased Cleanable.
The tests check that the implementation objects including
FileDescriptors are reclaimed
and for Linux that the raw fd counts are reduced as expected.
Webrev:
http://cr.openjdk.java.net/~rriggs/webrev-net-cleanup-8195059/
Thanks, Roger
More information about the core-libs-dev
mailing list