/*
 * Class:     java_net_AbstractPlainDatagramSocketImpl
 * Method:    init
 * Signature: ()V
 */
JNIEXPORT void JNICALL
Java_java_net_AbstractPlainDatagramSocketImpl_init(JNIEnv *env, jclass cls) {

    apdsi_fdID = (*env)->GetFieldID(env, cls, "fd",
                                   "Ljava/io/FileDescriptor;");
    CHECK_NULL(apdsi_fdID);

    IO_fd_fdID = NET_GetFileDescriptorID(env);
}
/*
 * Class:     java_net_DualStackPlainDatagramSocketImpl
 * Method:    initIDs
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_java_net_DualStackPlainDatagramSocketImpl_initIDs
  (JNIEnv *env, jclass clazz)
{
    pdsi_fdID = (*env)->GetFieldID(env, clazz, "fd",
                                   "Ljava/io/FileDescriptor;");
    CHECK_NULL(pdsi_fdID);
    IO_fd_fdID = NET_GetFileDescriptorID(env);
    CHECK_NULL(IO_fd_fdID);
    JNU_CHECK_EXCEPTION(env);
}
/*
 * Class:     java_net_SocketOutputStream
 * Method:    init
 * Signature: ()V
 */
JNIEXPORT void JNICALL
Java_java_net_SocketOutputStream_init(JNIEnv *env, jclass cls) {

    jclass fos_cls =
	(*env)->FindClass(env, "java/io/FileOutputStream");
    if (fos_cls == NULL) {
	return;  /* exception */
    }
    fos_fdID = (*env)->GetFieldID(env, fos_cls, "fd",
				  "Ljava/io/FileDescriptor;");
    IO_fd_fdID = NET_GetFileDescriptorID(env);
}
/*
 * Class:     java_net_AbstractPlainDatagramSocketImpl
 * Method:    init
 * Signature: ()V
 */
JNIEXPORT void JNICALL
Java_java_net_AbstractPlainDatagramSocketImpl_init(JNIEnv *env, jclass cls) {

    apdsi_fdID = (*env)->GetFieldID(env, cls, "fd",
                                   "Ljava/io/FileDescriptor;");
    CHECK_NULL(apdsi_fdID);
    IO_fd_fdID = NET_GetFileDescriptorID(env);
    CHECK_NULL(IO_fd_fdID);

    two_stacks_clazz = (*env)->FindClass(env, "java/net/TwoStacksPlainDatagramSocketImpl");
    CHECK_NULL(two_stacks_clazz);

    /* Handle both TwoStacks and DualStack here */

    if (JNU_Equals(env, cls, two_stacks_clazz)) {
        /* fd1 present only in TwoStack.. */
        apdsi_fd1ID = (*env)->GetFieldID(env, cls, "fd1",
                                   "Ljava/io/FileDescriptor;");
        CHECK_NULL(apdsi_fd1ID);
    }
}
Exemplo n.º 5
0
/*
 * Class:     java_net_SocketOutputStream
 * Method:    init
 * Signature: ()V
 */
JNIEXPORT void JNICALL
Java_java_net_SocketOutputStream_init(JNIEnv *env, jclass cls) {
    IO_fd_fdID = NET_GetFileDescriptorID(env);
}