mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-16 10:56:50 -04:00
#1351 renamed to hadshake
This commit is contained in:
parent
11343a694a
commit
77d894a911
@ -47,7 +47,7 @@ import java.util.ArrayList
|
|||||||
*/
|
*/
|
||||||
internal class PeerGroupHandshake(private val wifiDirectManager: WifiDirectManager) {
|
internal class PeerGroupHandshake(private val wifiDirectManager: WifiDirectManager) {
|
||||||
private val HANDSHAKE_MESSAGE = "Request Kiwix File Sharing"
|
private val HANDSHAKE_MESSAGE = "Request Kiwix File Sharing"
|
||||||
suspend fun peer(): InetAddress? = withContext(Dispatchers.IO) {
|
suspend fun handshake(): InetAddress? = withContext(Dispatchers.IO) {
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
Log.d(TAG, "Handshake in progress")
|
Log.d(TAG, "Handshake in progress")
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ class WifiDirectManager @Inject constructor(
|
|||||||
peerGroupHandshake = PeerGroupHandshake(this)
|
peerGroupHandshake = PeerGroupHandshake(this)
|
||||||
.also {
|
.also {
|
||||||
lifecycleCoroutineScope.launch {
|
lifecycleCoroutineScope.launch {
|
||||||
val inetAddress = it.peer()
|
val inetAddress = it.handshake()
|
||||||
inetAddress?.let(::setClientAddress) ?: if (BuildConfig.DEBUG) {
|
inetAddress?.let(::setClientAddress) ?: if (BuildConfig.DEBUG) {
|
||||||
Log.d(TAG, "InetAddress is null")
|
Log.d(TAG, "InetAddress is null")
|
||||||
displayToast(R.string.connection_refused, "", Toast.LENGTH_LONG)
|
displayToast(R.string.connection_refused, "", Toast.LENGTH_LONG)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user