harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r721570 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main: java/java/net/ java/org/apache/harmony/luni/net/ java/org/apache/harmony/luni/platform/ native/luni/shared/ native/luni/unix/
Date Fri, 28 Nov 2008 22:03:03 GMT
Author: tellison
Date: Fri Nov 28 14:03:02 2008
New Revision: 721570

URL: http://svn.apache.org/viewvc?rev=721570&view=rev
Log:
Remove multicast socket native call, and replace it with regular datagram socket creation.
The main difference here is that the setting of SO_REUSEADDR will be called for sockets created
from a user defined datagram socket factory (it wasn't previously).  Since we need the option
set, this is a good thing.

Removed:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainMulticastSocketImpl.java
Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/MulticastSocket.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketImplProvider.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/exports.txt

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/MulticastSocket.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/MulticastSocket.java?rev=721570&r1=721569&r2=721570&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/MulticastSocket.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/MulticastSocket.java
Fri Nov 28 14:03:02 2008
@@ -551,11 +551,10 @@
     synchronized void createSocket(int aPort, InetAddress addr)
             throws SocketException {
         impl = factory != null ? factory.createDatagramSocketImpl()
-                : SocketImplProvider.getMulticastSocketImpl();
+                : SocketImplProvider.getDatagramSocketImpl();
         impl.create();
         try {
-            // the required default options are now set in the VM where they
-            // should be
+            impl.setOption(SocketOptions.SO_REUSEADDR, Boolean.TRUE);
             impl.bind(aPort, addr);
             isBound = true;
         } catch (SocketException e) {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketImplProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketImplProvider.java?rev=721570&r1=721569&r2=721570&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketImplProvider.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/SocketImplProvider.java
Fri Nov 28 14:03:02 2008
@@ -51,10 +51,6 @@
         return new PlainDatagramSocketImpl();
     }
 
-    public static DatagramSocketImpl getMulticastSocketImpl() {
-        return new PlainMulticastSocketImpl();
-    }
-
     public static DatagramSocketImpl getDatagramSocketImpl(FileDescriptor fd, int localPort)
{
         return new PlainDatagramSocketImpl(fd, localPort);
     }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java?rev=721570&r1=721569&r2=721570&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java
Fri Nov 28 14:03:02 2008
@@ -119,9 +119,6 @@
 	public void connectDatagram(FileDescriptor aFD, int port, int trafficClass,
 			InetAddress inetAddress) throws SocketException;
 
-	public void createMulticastSocket(FileDescriptor aFD,
-			boolean preferIPv4Stack) throws SocketException;
-
 	/**
 	 * @deprecated Use {@link #read(FileDescriptor, byte[], int, int, int)}
 	 */

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java?rev=721570&r1=721569&r2=721570&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
Fri Nov 28 14:03:02 2008
@@ -102,30 +102,11 @@
             boolean preferIPv4Stack) throws SocketException;
 
     /**
-     * Answer the result of attempting to create a multicast socket in the IP
-     * stack. Any special options required for server sockets will be set by
-     * this method.
-     * 
-     * @param aFD
-     *            the socket FileDescriptor
-     * @param preferIPv4Stack
-     *            if use IPV4
-     * @throws SocketException
-     *             if an error occurs while creating the socket
-     *             
-     * @deprecated use {@link #createDatagramSocket(FileDescriptor, boolean)}
+     * @deprecated use {@link #createStreamSocket(FileDescriptor, boolean)}
      */
-    @Deprecated
-    public native void createMulticastSocket(FileDescriptor aFD,
-            boolean preferIPv4Stack) throws SocketException;
-
     public native void createSocket(FileDescriptor fd, boolean preferIPv4Stack)
             throws IOException;
 
-    /**
-     * @deprecated use {@link #createSocket(FileDescriptor, boolean)}
-     */
-    @Deprecated
     public native void createStreamSocket(FileDescriptor fd,
             boolean preferIPv4Stack) throws SocketException;
 

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c?rev=721570&r1=721569&r2=721570&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
Fri Nov 28 14:03:02 2008
@@ -343,28 +343,6 @@
 
 /*
  * Class:     org_apache_harmony_luni_platform_OSNetworkSystem
- * Method:    createMulticastSocket
- * Signature: (Ljava/io/FileDescriptor;Z)V
- */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_luni_platform_OSNetworkSystem_createMulticastSocket
-  (JNIEnv * env, jobject thiz, jobject thisObjFD, jboolean preferIPv4Stack)
-{
-  PORT_ACCESS_FROM_ENV(env);
-  BOOLEAN value = TRUE;
-  hysocket_t socketP;
-
-  createSocket(env, thisObjFD, HYSOCK_DGRAM, preferIPv4Stack);
-  socketP =
-    (hysocket_t) getJavaIoFileDescriptorContentsAsAPointer(env, thisObjFD);
-
-  hysock_setopt_bool(socketP, HY_SOL_SOCKET, HY_SO_REUSEPORT, &value);
-  hysock_setopt_bool(socketP, HY_SOL_SOCKET, HY_SO_REUSEADDR, &value);
-}
-
-
-/*
- * Class:     org_apache_harmony_luni_platform_OSNetworkSystem
  * Method:    read
  * Signature: (Ljava/io/FileDescriptor;[BIII)I
  */

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h?rev=721570&r1=721569&r2=721570&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h
Fri Nov 28 14:03:02 2008
@@ -154,15 +154,6 @@
 
 /*
  * Class:     org.apache.harmony.luni.platform.OSNetworkSystem
- * Method:    createMulticastSocket
- * Signature: (Ljava/io/FileDescriptor;Z)V
- * Throws:    java.net.SocketException
- */
-JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_createMulticastSocket
-  (JNIEnv *, jobject, jobject, jboolean);
-
-/*
- * Class:     org.apache.harmony.luni.platform.OSNetworkSystem
  * Method:    createSocket
  * Signature: (Ljava/io/FileDescriptor;Z)V
  * Throws:    java.io.IOException

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/exports.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/exports.txt?rev=721570&r1=721569&r2=721570&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/exports.txt (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/exports.txt Fri
Nov 28 14:03:02 2008
@@ -213,7 +213,6 @@
 Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramDirect
 Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendConnectedDatagram
 Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendConnectedDatagramDirect
-Java_org_apache_harmony_luni_platform_OSNetworkSystem_createMulticastSocket
 Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveStream
 Java_org_apache_harmony_luni_platform_OSNetworkSystem_shutdownInput
 Java_org_apache_harmony_luni_platform_OSNetworkSystem_shutdownOutput



Mime
View raw message