/** * Set the value of Java's Socket::socketHandle. */ static void put_socket (JNIEnv *env, jobject obj, void *s) { ensure_socket (env, obj); env->SetLongField (obj, socket_handle_fid, (jlong) s); }
/** * Get the value of Java's Socket::socketHandle. */ void *get_socket (JNIEnv *env, jobject obj) { ensure_socket (env, obj); void *s = (void*) env->GetLongField (obj, socket_handle_fid); return s; }
/** * Get the value of Java's Socket::socketHandle. */ static void *get_socket (JNIEnv *env, jobject obj, int do_assert) { ensure_socket (env, obj); void *s = (void*) env->GetLongField (obj, socket_handle_fid); if (do_assert) assert (s); return s; }