fix: call nativeStartSignaling from Java Thread with 8MB stack, not Kotlin IO dispatcher
This commit is contained in:
@@ -171,9 +171,12 @@ class CallViewModel : ViewModel(), WzpCallback {
|
|||||||
val seed = _seedHex.value
|
val seed = _seedHex.value
|
||||||
val alias = _alias.value
|
val alias = _alias.value
|
||||||
|
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
// Use a Java Thread with 8MB stack — Kotlin's IO dispatcher threads are too small
|
||||||
|
// for the native JNI + Rust + TLS stack requirements
|
||||||
val resolvedRelay = resolveToIp(relay) ?: relay
|
val resolvedRelay = resolveToIp(relay) ?: relay
|
||||||
|
Thread(null, {
|
||||||
val result = engine?.startSignaling(resolvedRelay, seed, "", alias)
|
val result = engine?.startSignaling(resolvedRelay, seed, "", alias)
|
||||||
|
viewModelScope.launch {
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
_signalState.value = 5 // Registered
|
_signalState.value = 5 // Registered
|
||||||
startStatsPolling()
|
startStatsPolling()
|
||||||
@@ -181,6 +184,7 @@ class CallViewModel : ViewModel(), WzpCallback {
|
|||||||
_errorMessage.value = "Failed to register on relay"
|
_errorMessage.value = "Failed to register on relay"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}, "wzp-register", 8 * 1024 * 1024).start()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Place a direct call to the target fingerprint */
|
/** Place a direct call to the target fingerprint */
|
||||||
|
|||||||
Reference in New Issue
Block a user