trilemma-dev / SecureXPC

A simple and secure XPC framework for Swift
MIT License
73 stars 15 forks source link

[help] How can I use FileHandle as argument of withMessageType #87

Closed chaosong closed 2 years ago

chaosong commented 2 years ago

I searched the code repository, and didn't find any code to handle this situation. Is there a Codable FileHandle example?

Thanks!

jakaplan commented 2 years ago

This is not currently supported. SecureXPC only supports types which can be (de)serialized, which is what Codable represents. File handles are inherently live references and therefore can't be serialized.

Note the underlying XPC framework does support sending file handles, but it's not supported by SecureXPC.

jakaplan commented 2 years ago

The 0.5.2 release now supports this via the new XPCFileDescriptorContainer.

chaosong commented 2 years ago

Bravo! It works. Thank you!