From 5ecc66d57b84a6a1a7db24d3240bdcd4af612152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= Date: Sat, 26 Jul 2025 11:40:17 +0200 Subject: [PATCH] Fix too short timeout interval --- NearbyShare/NearbyConnection.swift | 6 +++++- QuickDrop.xcodeproj/project.pbxproj | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NearbyShare/NearbyConnection.swift b/NearbyShare/NearbyConnection.swift index 235dbe8..153782a 100644 --- a/NearbyShare/NearbyConnection.swift +++ b/NearbyShare/NearbyConnection.swift @@ -30,7 +30,7 @@ class NearbyConnection { private var connectionClosed: Bool = false private var inactivityTimer: DispatchSourceTimer? - private let timeoutInterval: TimeInterval = 7 + private let timeoutInterval: TimeInterval = 100 // seconds // UKEY2-related state var publicKey: ECPublicKey? @@ -253,10 +253,14 @@ class NearbyConnection { } func sendTransferSetupFrame(_ frame: Sharing_Nearby_Frame) throws { + log("Sending transfer setup frame.") try sendBytesPayload(data: frame.serializedData(), id: Int64.random(in: Int64.min ... Int64.max)) } func sendBytesPayload(data: Data, id: Int64) throws { + + log("Sending bytes payload with ID \(id) of length \(data.count)") + var transfer = Location_Nearby_Connections_PayloadTransferFrame() transfer.packetType = .data transfer.payloadChunk.offset = 0 diff --git a/QuickDrop.xcodeproj/project.pbxproj b/QuickDrop.xcodeproj/project.pbxproj index e98c0b5..2101ddc 100644 --- a/QuickDrop.xcodeproj/project.pbxproj +++ b/QuickDrop.xcodeproj/project.pbxproj @@ -915,7 +915,7 @@ MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; - SHARED_BUILD = 51; + SHARED_BUILD = 52; SHARED_VERSION = 1.10.3; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -974,7 +974,7 @@ MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; - SHARED_BUILD = 51; + SHARED_BUILD = 52; SHARED_VERSION = 1.10.3; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O";