예제 #1
0
/*
 * Class:     com_iwebpp_libuvpp_handles_LoopHandle
 * Method:    _get_last_error
 * Signature: (J)Lcom/iwebpp/libuvpp/NativeException;
 */
extern "C" JNIEXPORT  jthrowable JNICALL Java_com_iwebpp_libuvpp_handles_LoopHandle__1get_1last_1error
  (JNIEnv *env, jobject that, jlong ptr) {

  assert(ptr);
  uv_loop_t* loop = reinterpret_cast<uv_loop_t*>(ptr);
  int code = uv_last_error(loop).code;

  return NewException(env, code);
}
예제 #2
0
void UDPCallbacks::on_send(int status, int error_code, jobject buffer, jobject context) {
  assert(_env);

  jthrowable exception = error_code ? NewException(_env, error_code) : NULL;
  _env->CallVoidMethod(
      _instance,
      _send_callback_mid,
      status,
      exception,
      context);
}