Loading core/java/android/net/LocalSocketImpl.java +7 −14 Original line number Diff line number Diff line Loading @@ -205,16 +205,6 @@ class LocalSocketImpl private native Credentials getPeerCredentials_native( FileDescriptor fd) throws IOException; /** * Accepts a connection on a server socket. * * @param fd file descriptor of server socket * @param s socket implementation that will become the new socket * @return file descriptor of new socket */ private native FileDescriptor accept (FileDescriptor fd, LocalSocketImpl s) throws IOException; /** * Create a new instance. */ Loading Loading @@ -338,14 +328,17 @@ class LocalSocketImpl * @param s a socket that will be used to represent the new connection. * @throws IOException */ protected void accept(LocalSocketImpl s) throws IOException { protected void accept(LocalSocketImpl s) throws IOException { if (fd == null) { throw new IOException("socket not created"); } s.fd = accept(fd, s); try { s.fd = Os.accept(fd, null /* address */); s.mFdCreatedInternally = true; } catch (ErrnoException e) { throw e.rethrowAsIOException(); } } /** Loading core/jni/android_net_LocalSocketImpl.cpp +0 −44 Original line number Diff line number Diff line Loading @@ -112,49 +112,6 @@ socket_bind_local (JNIEnv *env, jobject object, jobject fileDescriptor, } } /* private native FileDescriptor ** accept (FileDescriptor fd, LocalSocketImpl s) ** throws IOException; */ static jobject socket_accept (JNIEnv *env, jobject object, jobject fileDescriptor, jobject s) { union { struct sockaddr address; struct sockaddr_un un_address; } sa; int ret; int retFD; int fd; socklen_t addrlen; if (s == NULL) { jniThrowNullPointerException(env, NULL); return NULL; } fd = jniGetFDFromFileDescriptor(env, fileDescriptor); if (env->ExceptionCheck()) { return NULL; } do { addrlen = sizeof(sa); ret = accept(fd, &(sa.address), &addrlen); } while (ret < 0 && errno == EINTR); if (ret < 0) { jniThrowIOException(env, errno); return NULL; } retFD = ret; return jniCreateFileDescriptor(env, retFD); } /* private native void shutdown(FileDescriptor fd, boolean shutdownInput) */ static void Loading Loading @@ -566,7 +523,6 @@ static JNINativeMethod gMethods[] = { {"connectLocal", "(Ljava/io/FileDescriptor;Ljava/lang/String;I)V", (void*)socket_connect_local}, {"bindLocal", "(Ljava/io/FileDescriptor;Ljava/lang/String;I)V", (void*)socket_bind_local}, {"accept", "(Ljava/io/FileDescriptor;Landroid/net/LocalSocketImpl;)Ljava/io/FileDescriptor;", (void*)socket_accept}, {"shutdown", "(Ljava/io/FileDescriptor;Z)V", (void*)socket_shutdown}, {"read_native", "(Ljava/io/FileDescriptor;)I", (void*) socket_read}, {"readba_native", "([BIILjava/io/FileDescriptor;)I", (void*) socket_readba}, Loading Loading
core/java/android/net/LocalSocketImpl.java +7 −14 Original line number Diff line number Diff line Loading @@ -205,16 +205,6 @@ class LocalSocketImpl private native Credentials getPeerCredentials_native( FileDescriptor fd) throws IOException; /** * Accepts a connection on a server socket. * * @param fd file descriptor of server socket * @param s socket implementation that will become the new socket * @return file descriptor of new socket */ private native FileDescriptor accept (FileDescriptor fd, LocalSocketImpl s) throws IOException; /** * Create a new instance. */ Loading Loading @@ -338,14 +328,17 @@ class LocalSocketImpl * @param s a socket that will be used to represent the new connection. * @throws IOException */ protected void accept(LocalSocketImpl s) throws IOException { protected void accept(LocalSocketImpl s) throws IOException { if (fd == null) { throw new IOException("socket not created"); } s.fd = accept(fd, s); try { s.fd = Os.accept(fd, null /* address */); s.mFdCreatedInternally = true; } catch (ErrnoException e) { throw e.rethrowAsIOException(); } } /** Loading
core/jni/android_net_LocalSocketImpl.cpp +0 −44 Original line number Diff line number Diff line Loading @@ -112,49 +112,6 @@ socket_bind_local (JNIEnv *env, jobject object, jobject fileDescriptor, } } /* private native FileDescriptor ** accept (FileDescriptor fd, LocalSocketImpl s) ** throws IOException; */ static jobject socket_accept (JNIEnv *env, jobject object, jobject fileDescriptor, jobject s) { union { struct sockaddr address; struct sockaddr_un un_address; } sa; int ret; int retFD; int fd; socklen_t addrlen; if (s == NULL) { jniThrowNullPointerException(env, NULL); return NULL; } fd = jniGetFDFromFileDescriptor(env, fileDescriptor); if (env->ExceptionCheck()) { return NULL; } do { addrlen = sizeof(sa); ret = accept(fd, &(sa.address), &addrlen); } while (ret < 0 && errno == EINTR); if (ret < 0) { jniThrowIOException(env, errno); return NULL; } retFD = ret; return jniCreateFileDescriptor(env, retFD); } /* private native void shutdown(FileDescriptor fd, boolean shutdownInput) */ static void Loading Loading @@ -566,7 +523,6 @@ static JNINativeMethod gMethods[] = { {"connectLocal", "(Ljava/io/FileDescriptor;Ljava/lang/String;I)V", (void*)socket_connect_local}, {"bindLocal", "(Ljava/io/FileDescriptor;Ljava/lang/String;I)V", (void*)socket_bind_local}, {"accept", "(Ljava/io/FileDescriptor;Landroid/net/LocalSocketImpl;)Ljava/io/FileDescriptor;", (void*)socket_accept}, {"shutdown", "(Ljava/io/FileDescriptor;Z)V", (void*)socket_shutdown}, {"read_native", "(Ljava/io/FileDescriptor;)I", (void*) socket_read}, {"readba_native", "([BIILjava/io/FileDescriptor;)I", (void*) socket_readba}, Loading