Author: tellison
Date: Fri Nov 28 07:24:53 2008
New Revision: 721516
URL: http://svn.apache.org/viewvc?rev=721516&view=rev
Log:
Remove concept of 'serverStreamSocket'.
Move different socket creation functions together in native code.
Mark (as deprecated) other candidates for deletion.
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainServerSocketImpl.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/org/apache/harmony/luni/net/PlainServerSocketImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainServerSocketImpl.java?rev=721516&r1=721515&r2=721516&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainServerSocketImpl.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainServerSocketImpl.java
Fri Nov 28 07:24:53 2008
@@ -46,7 +46,7 @@
protected void create(boolean isStreaming) throws SocketException {
streaming = isStreaming;
if (isStreaming) {
- netImpl.createServerStreamSocket(fd, NetUtil.preferIPv4Stack());
+ netImpl.createStreamSocket(fd, NetUtil.preferIPv4Stack());
} else {
netImpl.createDatagramSocket(fd, NetUtil.preferIPv4Stack());
}
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=721516&r1=721515&r2=721516&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 07:24:53 2008
@@ -122,9 +122,6 @@
public void createMulticastSocket(FileDescriptor aFD,
boolean preferIPv4Stack) throws SocketException;
- public void createServerStreamSocket(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=721516&r1=721515&r2=721516&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 07:24:53 2008
@@ -112,26 +112,20 @@
* if use IPV4
* @throws SocketException
* if an error occurs while creating the socket
+ *
+ * @deprecated use {@link #createDatagramSocket(FileDescriptor, boolean)}
*/
+ @Deprecated
public native void createMulticastSocket(FileDescriptor aFD,
boolean preferIPv4Stack) throws SocketException;
- /**
- * Answer the result of attempting to create a server stream 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
- */
- public native void createServerStreamSocket(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=721516&r1=721515&r2=721516&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 07:24:53 2008
@@ -302,23 +302,67 @@
*/
JNIEXPORT void JNICALL
Java_org_apache_harmony_luni_platform_OSNetworkSystem_createSocket
- (JNIEnv * env, jobject thiz, jobject fileDescriptor, jboolean preferIPv4Stack)
+ (JNIEnv * env, jobject thiz, jobject fd, jboolean preferIPv4Stack)
{
- createSocket(env, fileDescriptor, HYSOCK_STREAM, preferIPv4Stack);
+ createSocket(env, fd, HYSOCK_STREAM, preferIPv4Stack);
}
+
+/*
+ * Class: org_apache_harmony_luni_platform_OSNetworkSystem
+ * Method: createStreamSocket
+ * Signature: (Ljava/io/FileDescriptor;Z)V
+ */
+JNIEXPORT void JNICALL
+Java_org_apache_harmony_luni_platform_OSNetworkSystem_createStreamSocket
+ (JNIEnv * env, jobject thiz, jobject thisObjFD, jboolean preferIPv4Stack)
+{
+ hysocket_t socketP;
+
+ createSocket(env, thisObjFD, HYSOCK_STREAM, preferIPv4Stack);
+ socketP =
+ (hysocket_t) getJavaIoFileDescriptorContentsAsAPointer(env, thisObjFD);
+
+ /* Sets HY_SO_REUSEADDR = TRUE on Linux only */
+ setPlatformBindOptions(env, socketP);
+}
+
+
/*
* Class: org_apache_harmony_luni_platform_OSNetworkSystem
- * Method: createDatagram
+ * Method: createDatagramSocket
* Signature: (Ljava/io/FileDescriptor;Z)V
*/
JNIEXPORT void JNICALL
Java_org_apache_harmony_luni_platform_OSNetworkSystem_createDatagramSocket
- (JNIEnv * env, jobject thiz, jobject fileDescriptor, jboolean preferIPv4Stack)
+ (JNIEnv * env, jobject thiz, jobject fd, jboolean preferIPv4Stack)
+{
+ createSocket(env, fd, HYSOCK_DGRAM, preferIPv4Stack);
+}
+
+
+/*
+ * 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)
{
- createSocket(env, fileDescriptor, HYSOCK_DGRAM, 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
@@ -1375,44 +1419,6 @@
}
}
-/*
- * Class: org_apache_harmony_luni_platform_OSNetworkSystem
- * Method: createServerStreamSocket
- * Signature: (Ljava/io/FileDescriptor;Z)V
- */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_luni_platform_OSNetworkSystem_createServerStreamSocket
- (JNIEnv * env, jobject thiz, jobject thisObjFD, jboolean preferIPv4Stack)
-{
- hysocket_t socketP;
-
- createSocket(env, thisObjFD, HYSOCK_STREAM, preferIPv4Stack);
- socketP =
- (hysocket_t) getJavaIoFileDescriptorContentsAsAPointer(env, thisObjFD);
-
- setDefaultServerSocketOptions(env, socketP);
-}
-
-/*
- * 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
@@ -1783,24 +1789,6 @@
updateSocket(env, &sockaddrP, socketNew, socketImpl, fdSocketImpl);
}
-/*
- * Class: org_apache_harmony_luni_platform_OSNetworkSystem
- * Method: createStreamSocket
- * Signature: (Ljava/io/FileDescriptor;Z)V
- */
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_luni_platform_OSNetworkSystem_createStreamSocket
- (JNIEnv * env, jobject thiz, jobject thisObjFD, jboolean preferIPv4Stack)
-{
- hysocket_t socketP;
-
- createSocket(env, thisObjFD, HYSOCK_STREAM, preferIPv4Stack);
- socketP =
- (hysocket_t) getJavaIoFileDescriptorContentsAsAPointer(env, thisObjFD);
-
- setPlatformBindOptions(env, socketP);
-}
-
/*
* Class: org_apache_harmony_luni_platform_OSNetworkSystem
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=721516&r1=721515&r2=721516&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 07:24:53 2008
@@ -163,15 +163,6 @@
/*
* Class: org.apache.harmony.luni.platform.OSNetworkSystem
- * Method: createServerStreamSocket
- * Signature: (Ljava/io/FileDescriptor;Z)V
- * Throws: java.net.SocketException
- */
-JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_createServerStreamSocket
- (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=721516&r1=721515&r2=721516&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 07:24:53 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_createServerStreamSocket
Java_org_apache_harmony_luni_platform_OSNetworkSystem_createMulticastSocket
Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveStream
Java_org_apache_harmony_luni_platform_OSNetworkSystem_shutdownInput
|