changeset 4490:611544ae65f6

7099488: TwoStacksPlainSocketImpl should invoke super.create(stream), typo in fix for 7098719 Reviewed-by: michaelm, coffeys
author chegar
date Wed, 19 Oct 2011 11:27:34 +0100
parents 1603c0710938
children 7daed05cc0e7
files src/share/classes/java/net/AbstractPlainSocketImpl.java src/windows/classes/java/net/TwoStacksPlainSocketImpl.java
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/net/AbstractPlainSocketImpl.java	Wed Oct 19 11:24:02 2011 +0100
+++ b/src/share/classes/java/net/AbstractPlainSocketImpl.java	Wed Oct 19 11:27:34 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/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java	Wed Oct 19 11:24:02 2011 +0100
+++ b/src/windows/classes/java/net/TwoStacksPlainSocketImpl.java	Wed Oct 19 11:27:34 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;