harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghar...@apache.org
Subject svn commit: r417579 - /incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/ServerSocketChannelImpl.java
Date Tue, 27 Jun 2006 20:24:20 GMT
Author: gharley
Date: Tue Jun 27 13:24:20 2006
New Revision: 417579

URL: http://svn.apache.org/viewvc?rev=417579&view=rev
Log:
HARMONY 675 : Refactor ServerSocketAdapter.accept in o.a.h.nio.internal.ServerSocketChannelImpl

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/ServerSocketChannelImpl.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/ServerSocketChannelImpl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/ServerSocketChannelImpl.java?rev=417579&r1=417578&r2=417579&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/ServerSocketChannelImpl.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/ServerSocketChannelImpl.java
Tue Jun 27 13:24:20 2006
@@ -204,7 +204,7 @@
     }
 
     /*
-     * The adapter class of ServerSocekt.
+     * The adapter class of ServerSocket.
      */
     private class ServerSocketAdapter extends ServerSocket {
         /*
@@ -233,7 +233,7 @@
         /*
          * do the accept.
          */
-        public Socket accept(Socket aSocket, SocketChannelImpl sockChannel)
+        private Socket accept(Socket aSocket, SocketChannelImpl sockChannel)
                 throws IOException {
             if (isClosed()) {
                 throw new SocketException(Msg.getString("K003d")); //$NON-NLS-1$
@@ -242,28 +242,13 @@
                 throw new SocketException(Msg.getString("K031f")); //$NON-NLS-1$
             }
 
-            // If a SOCKS proxy is being used, accept does strange things.
-            // Instead of returning a new Socket and allowing this ServerSocket
-            // to be used for another accept, it actually uses the current
-            // ServerSocket
-            // as the accepted Socket. So, closing the returned socket will
-            // close the
-            // ServerSocket as well. The ServerSocket cannot be used for a
-            // second accept.
-            if (NetUtil.usingSocks(null)) {
-                return super.accept();
-            }
-
             // a new socket is pass in so we do not need to "Socket aSocket =
             // new Socket();"
             boolean connectOK = false;
             try {
                 synchronized (this) {
                     super.implAccept(aSocket);
-                    // FIXME wait for fix.
-                    // if (aSocket.isConnected()) {
                     sockChannel.setConnected();
-                    // }
                 }
                 SecurityManager sm = System.getSecurityManager();
                 if (sm != null) {
@@ -321,4 +306,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}



Mime
View raw message