commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1098569 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr/socks.h shared/dsock.c shared/psock.c shared/ssock.c
Date Mon, 02 May 2011 13:54:17 GMT
Author: mturk
Date: Mon May  2 13:54:16 2011
New Revision: 1098569

URL: http://svn.apache.org/viewvc?rev=1098569&view=rev
Log:
Make private native api for selectors

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/acr/socks.h
    commons/sandbox/runtime/trunk/src/main/native/shared/dsock.c
    commons/sandbox/runtime/trunk/src/main/native/shared/psock.c
    commons/sandbox/runtime/trunk/src/main/native/shared/ssock.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/socks.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/socks.h?rev=1098569&r1=1098568&r2=1098569&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr/socks.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr/socks.h Mon May  2 13:54:16
2011
@@ -45,6 +45,9 @@ ACR_CLASS_DTOR(Socket);
 
 jobject AcrGetSocketImplFd(JNI_STDARGS);
 jobject AcrGetDatagramSocketImplFd(JNI_STDARGS);
+int     AcrGetSocketFd(JNI_STDARGS);
+int     AcrGetServerSocketFd(JNI_STDARGS);
+int     AcrGetDatagramSocketFd(JNI_STDARGS);
 
 #ifdef __cplusplus
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/dsock.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/dsock.c?rev=1098569&r1=1098568&r2=1098569&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/dsock.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/dsock.c Mon May  2 13:54:16 2011
@@ -81,18 +81,19 @@ ACR_NET_EXPORT(jobject, DatagramSocketIn
         return 0;
 }
 
-ACR_NET_EXPORT(jint, DatagramSocketInstance, nd0)(JNI_STDARGS, jobject sock)
+int
+AcrGetDatagramSocketFd(JNI_STDARGS)
 {
     jobject impl = 0;
     jobject fd;
 
     if (J4FLD_OFF(0000) != INVALID_FIELD_OFFSET) {
-        char *oa = *(char **)sock;
+        char *oa = *(char **)obj;
         if (oa != 0)
             impl = (jobject)(oa + J4FLD_PTR(0000));
     }
     else if (CLAZZ_LOADED) {
-        impl = GET_IFIELD_O(0000, sock);
+        impl = GET_IFIELD_O(0000, obj);
     }
     if (impl != 0) {
         fd = AcrGetDatagramSocketImplFd(env, impl);
@@ -102,6 +103,11 @@ ACR_NET_EXPORT(jint, DatagramSocketInsta
     return -1;
 }
 
+ACR_NET_EXPORT(jint, DatagramSocketInstance, nd0)(JNI_STDARGS, jobject sock)
+{
+    return AcrGetDatagramSocketFd(env, sock);
+}
+
 ACR_NET_EXPORT(jint, DatagramSocketInstance, sd0)(JNI_STDARGS, jobject sock, jint sd)
 {
     jobject impl = 0;

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/psock.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/psock.c?rev=1098569&r1=1098568&r2=1098569&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/psock.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/psock.c Mon May  2 13:54:16 2011
@@ -83,18 +83,19 @@ ACR_NET_EXPORT(jobject, SocketInstance, 
         return 0;
 }
 
-ACR_NET_EXPORT(jint, SocketInstance, nd0)(JNI_STDARGS, jobject sock)
+int
+AcrGetSocketFd(JNI_STDARGS)
 {
     jobject impl = 0;
     jobject fd;
 
     if (J4FLD_OFF(0000) != INVALID_FIELD_OFFSET) {
-        char *oa = *(char **)sock;
+        char *oa = *(char **)obj;
         if (oa != 0)
             impl = (jobject)(oa + J4FLD_PTR(0000));
     }
     else if (CLAZZ_LOADED) {
-        impl = GET_IFIELD_O(0000, sock);
+        impl = GET_IFIELD_O(0000, obj);
     }
     if (impl != 0) {
         fd = AcrGetSocketImplFd(env, impl);
@@ -104,6 +105,11 @@ ACR_NET_EXPORT(jint, SocketInstance, nd0
     return -1;
 }
 
+ACR_NET_EXPORT(jint, SocketInstance, nd0)(JNI_STDARGS, jobject sock)
+{
+    return AcrGetSocketFd(env, sock);
+}
+
 ACR_NET_EXPORT(jint, SocketInstance, sd0)(JNI_STDARGS, jobject sock, jint sd)
 {
     jobject impl = 0;

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/ssock.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/ssock.c?rev=1098569&r1=1098568&r2=1098569&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/ssock.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/ssock.c Mon May  2 13:54:16 2011
@@ -74,18 +74,19 @@ ACR_NET_EXPORT(jobject, SocketInstance, 
         return 0;
 }
 
-ACR_NET_EXPORT(jint, SocketInstance, nd1)(JNI_STDARGS, jobject sock)
+int
+AcrGetServerSocketFd(JNI_STDARGS)
 {
     jobject impl = 0;
     jobject fd;
 
     if (J4FLD_OFF(0000) != INVALID_FIELD_OFFSET) {
-        char *oa = *(char **)sock;
+        char *oa = *(char **)obj;
         if (oa != 0)
             impl = (jobject)(oa + J4FLD_PTR(0000));
     }
     else if (CLAZZ_LOADED) {
-        impl = GET_IFIELD_O(0000, sock);
+        impl = GET_IFIELD_O(0000, obj);
     }
     if (impl != 0) {
         fd = AcrGetSocketImplFd(env, impl);
@@ -95,6 +96,11 @@ ACR_NET_EXPORT(jint, SocketInstance, nd1
     return -1;
 }
 
+ACR_NET_EXPORT(jint, SocketInstance, nd1)(JNI_STDARGS, jobject sock)
+{
+    return AcrGetServerSocketFd(env, sock);
+}
+
 ACR_NET_EXPORT(jint, SocketInstance, sd1)(JNI_STDARGS, jobject sock, jint sd)
 {
     jobject impl = 0;



Mime
View raw message