harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r427916 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/org/apache/harmony/luni/net/PlainSocketImpl.java test/java/tests/api/java/net/SocketTest.java
Date Wed, 02 Aug 2006 06:38:32 GMT
Author: pyang
Date: Tue Aug  1 23:38:31 2006
New Revision: 427916

URL: http://svn.apache.org/viewvc?rev=427916&view=rev
Log:
Fix for HARMONY-946 ([classlib][luni] new Socket("0.0.0.0", 1099) on Windows throws exception)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/SocketTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java?rev=427916&r1=427915&r2=427916&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java
Tue Aug  1 23:38:31 2006
@@ -225,12 +225,12 @@
 					if (timeout == 0) {
 						// PlainSocketImpl2.connectStreamSocketImpl2(fd, aPort,
 						// trafficClass, address);
-						netImpl.connect(fd, trafficClass, anAddr, aPort);
+						netImpl.connect(fd, trafficClass, address, aPort);
 					} else {
 						// PlainSocketImpl2.connectStreamWithTimeoutSocketImpl2(
 						// fd, aPort, timeout, trafficClass, address);
 						netImpl.connectStreamWithTimeoutSocket(fd, aPort,
-								timeout, trafficClass, anAddr);
+								timeout, trafficClass, address);
 					}
 				}
 			}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/SocketTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/SocketTest.java?rev=427916&r1=427915&r2=427916&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/SocketTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/SocketTest.java
Tue Aug  1 23:38:31 2006
@@ -95,6 +95,25 @@
 		int sport = startServer("Cons String,I");
 		s = new Socket(InetAddress.getLocalHost().getHostName(), sport);
 		assertTrue("Failed to create socket", s.getPort() == sport);
+        
+		//regression for HARMONY-946
+        ServerSocket ss = null;
+        Socket s = null;
+        try{
+            ss = new ServerSocket(0);
+            s = new Socket("0.0.0.0 ", ss.getLocalPort());
+        }finally{
+            try{
+                ss.close();
+            }catch(Exception e){
+                //ignore
+            }
+            try{
+                s.close();
+            }catch(Exception e){
+                //ignore
+            }
+        }
 	}
 
 	/**
@@ -2414,7 +2433,7 @@
             // expected
         }
     }
-
+    
 	/**
 	 * Sets up the fixture, for example, open a network connection. This method
 	 * is called before a test is executed.



Mime
View raw message