diff --git a/.gitmodules b/.gitmodules index 855eef1d..d1fb2074 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "app/src/main/jni/jnienet/enet"] path = app/src/main/jni/jnienet/enet - url = https://github.com/lsalzman/enet.git + url = https://github.com/cgutman/enet.git \ No newline at end of file diff --git a/app/libs/limelight-common.jar b/app/libs/limelight-common.jar index 88f87e50..802f3bc7 100644 Binary files a/app/libs/limelight-common.jar and b/app/libs/limelight-common.jar differ diff --git a/app/libs/tinyrtsp.jar b/app/libs/tinyrtsp.jar index e87fa76d..6805b31c 100644 Binary files a/app/libs/tinyrtsp.jar and b/app/libs/tinyrtsp.jar differ diff --git a/app/src/main/jni/jnienet/enet b/app/src/main/jni/jnienet/enet index 4d106717..4f7ef11c 160000 --- a/app/src/main/jni/jnienet/enet +++ b/app/src/main/jni/jnienet/enet @@ -1 +1 @@ -Subproject commit 4d1067179bd933c6bf6465c406243472128fa34b +Subproject commit 4f7ef11c2352dc53539d1ff93887ef637a6c2e2f diff --git a/app/src/main/jni/jnienet/jnienet.c b/app/src/main/jni/jnienet/jnienet.c index 35e81c0a..a82752f1 100644 --- a/app/src/main/jni/jnienet/jnienet.c +++ b/app/src/main/jni/jnienet/jnienet.c @@ -30,7 +30,7 @@ Java_com_limelight_nvstream_enet_EnetConnection_connectToPeer(JNIEnv *env, jobje // Initialize the ENet address addrStr = (*env)->GetStringUTFChars(env, address, 0); enet_address_set_host(&enetAddress, addrStr); - enetAddress.port = port; + enet_address_set_port(&enetAddress, port); (*env)->ReleaseStringUTFChars(env, address, addrStr); // Start the connection @@ -47,6 +47,9 @@ Java_com_limelight_nvstream_enet_EnetConnection_connectToPeer(JNIEnv *env, jobje // Ensure the connect verify ACK is sent immediately enet_host_flush(LONG_TO_CLIENT(client)); + + // Set the max peer timeout to 10 seconds + enet_peer_timeout(peer, ENET_PEER_TIMEOUT_LIMIT, ENET_PEER_TIMEOUT_MINIMUM, 10000); return PEER_TO_LONG(peer); } @@ -68,7 +71,8 @@ Java_com_limelight_nvstream_enet_EnetConnection_readPacket(JNIEnv *env, jobject // Check that the packet isn't too large if (event.packet->dataLength > length) { - return -1; + enet_packet_destroy(event.packet); + return event.packet->dataLength; } // Copy the packet data into the caller's buffer