7099488: TwoStacksPlainSocketImpl should invoke super.create(stream), typo in fix for 7098719
authorchegar
Tue, 11 Oct 2011 12:06:46 +0100
changeset 10708 f255532bf336
parent 10707 7de027b93fee
child 10709 d865c9f21240
7099488: TwoStacksPlainSocketImpl should invoke super.create(stream), typo in fix for 7098719 Reviewed-by: coffeys
jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java
jdk/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java
--- a/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java	Mon Oct 10 16:13:38 2011 +0100
+++ b/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java	Tue Oct 11 12:06:46 2011 +0100
@@ -71,7 +71,7 @@
 
    /* whether this Socket is a stream (TCP) socket or not (UDP)
     */
-    private boolean stream;
+    protected boolean stream;
 
     /**
      * Load net library into runtime.
--- a/jdk/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java	Mon Oct 10 16:13:38 2011 +0100
+++ b/jdk/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java	Tue Oct 11 12:06:46 2011 +0100
@@ -26,6 +26,7 @@
 
 import java.io.IOException;
 import java.io.FileDescriptor;
+import sun.net.ResourceManager;
 
 /*
  * This class defines the plain SocketImpl that is used for all
@@ -82,7 +83,7 @@
     protected synchronized void create(boolean stream) throws IOException {
         fd1 = new FileDescriptor();
         try {
-            super.create();
+            super.create(stream);
         } catch (IOException e) {
             fd1 = null;
             throw e;
@@ -125,6 +126,9 @@
     protected void close() throws IOException {
         synchronized(fdLock) {
             if (fd != null || fd1 != null) {
+                if (!stream) {
+                    ResourceManager.afterUdpClose();
+                }
                 if (fdUseCount == 0) {
                     if (closePending) {
                         return;