mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-17 22:10:09 +00:00
Add network connection test
This commit is contained in:
@@ -101,4 +101,32 @@ Java_com_limelight_nvstream_jni_MoonBridge_getPendingAudioDuration(JNIEnv *env,
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_limelight_nvstream_jni_MoonBridge_getPendingVideoFrames(JNIEnv *env, jclass clazz) {
|
||||
return LiGetPendingVideoFrames();
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_limelight_nvstream_jni_MoonBridge_testClientConnectivity(JNIEnv *env, jclass clazz, jstring testServerHostName, jint referencePort, jint testFlags) {
|
||||
int ret;
|
||||
const char* testServerHostNameStr = (*env)->GetStringUTFChars(env, testServerHostName, NULL);
|
||||
|
||||
ret = LiTestClientConnectivity(testServerHostNameStr, (unsigned short)referencePort, testFlags);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, testServerHostName, testServerHostNameStr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_limelight_nvstream_jni_MoonBridge_getPortFromPortFlagIndex(JNIEnv *env, jclass clazz, jint portFlagIndex) {
|
||||
return LiGetPortFromPortFlagIndex(portFlagIndex);
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_limelight_nvstream_jni_MoonBridge_getProtocolFromPortFlagIndex(JNIEnv *env, jclass clazz, jint portFlagIndex) {
|
||||
int protocol = LiGetProtocolFromPortFlagIndex(portFlagIndex);
|
||||
return (*env)->NewStringUTF(env, protocol == IPPROTO_TCP ? "TCP" : "UDP");
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_limelight_nvstream_jni_MoonBridge_getPortFlagsFromStage(JNIEnv *env, jclass clazz, jint stage) {
|
||||
return LiGetPortFlagsFromStage(stage);
|
||||
}
|
||||
Reference in New Issue
Block a user