mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-22 14:26:01 +00:00
Allow multiple incoming connections
This commit is contained in:
1 parent
bb1f28af0b
commit
6401c1969c
2 files changed
-19
No files matched your search
@@ -29,7 +29,6 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
||||
private var tcpListener: NWListener
|
||||
private var mdnsServices: [NetService] = []
|
||||
private var incomingConnections: [String: InboundNearbyConnection] = [:]
|
||||
private var activeIncomingTransferID: String?
|
||||
private var foundServices: [String: FoundServiceInfo] = [:]
|
||||
private var outboundAppDelegates: [OutboundAppDelegate] = []
|
||||
private var inboundAppDelegates: [InboundAppDelegate] = []
|
||||
@@ -341,9 +340,6 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
||||
|
||||
|
||||
func connectionWasTerminated(connection: InboundNearbyConnection, savedFiles: [URL], error: Error?) {
|
||||
if activeIncomingTransferID == connection.id {
|
||||
activeIncomingTransferID = nil
|
||||
}
|
||||
incomingConnections.removeValue(forKey: connection.id)
|
||||
|
||||
if !connection.wasUserRejected {
|
||||
@@ -486,15 +482,6 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
||||
}
|
||||
}
|
||||
|
||||
func claimIncomingTransfer(id: String) -> Bool {
|
||||
if let activeIncomingTransferID, activeIncomingTransferID != id {
|
||||
return false
|
||||
}
|
||||
activeIncomingTransferID = id
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
private func endpointID(for service: NWBrowser.Result) -> String? {
|
||||
guard case let NWEndpoint.service(name: serviceName, type: _, domain: _, interface: _) = service.endpoint else { return nil }
|
||||
guard let nameData = Data.dataFromUrlSafeBase64(serviceName) else { return nil }
|
||||
|
||||
Reference in new issue
Block a user