8195059: Update java.net Socket and DatagramSocket implementations to use Cleaner

Reviewed-by: chegar, plevart
This commit is contained in:
Roger Riggs 2018-02-02 14:17:07 -05:00
parent 89c2e03b1d
commit 0b8689b331
15 changed files with 1113 additions and 60 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -549,6 +549,7 @@ class ServerSocket implements java.io.Closeable {
si.address = new InetAddress();
si.fd = new FileDescriptor();
getImpl().accept(si);
SocketCleanable.register(si.fd); // raw fd has been set
SecurityManager security = System.getSecurityManager();
if (security != null) {