Properly implement listener should accept connection in ClientCommunicationService

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-11-21 17:03:45 +08:00
parent 026f082253
commit ac43369bed

View file

@ -32,6 +32,11 @@ class ClientCommunicationService: NSObject, NSFileProviderServiceSource, NSXPCLi
func listener(_ listener: NSXPCListener,
shouldAcceptNewConnection newConnection: NSXPCConnection)
-> Bool {
let clientCommProtocol = ClientCommunicationProtocol.self
let clientCommInterface = NSXPCInterface(with: clientCommProtocol)
newConnection.exportedInterface = clientCommInterface
newConnection.exportedObject = self
newConnection.resume()
return true
}