Closed amomchilov closed 2 years ago
I've very briefly started looking into this, but haven't done any actual testing yet. I'd be rather surprised if what we currently have works in all cases as it's inconsistent:
XPCAnonymousServer
returns the listener connection, which absolutely works as demonstrated by our testsXPCMachServer
returns the listener connection if the server has been started, otherwise fatalError
s out
XPCAnonymousServer
XPCAnonymousServer
XPCServiceServer
returns the most recent client connection it's received (but in practice I think it'd only ever receive one?)
xpc_main
is the one and only entry pointIf it's true that there's no equivalent for XPC Services and therefore no way to return an XPCServerEndpoint
, I think we could do one or both of the following:
endpoint
property to NonBlockingStartable
(and rename it)start()
function defined by NonBlockingStartable
return the NonBlockingStartable
I've confirmed that exporting a connection for an XPCMachServer
works correctly. So in terms of exactly this issue, I've put up PR #45 for this.
Since this does work and it differs from XPCServiceServer
's behavior, educated guess that the endpoint
for the XPCServiceServer
doesn't work properly (and probably can't work). I've created issue #46 for this.
https://github.com/trilemma-dev/SecureXPC/blob/ab4e612fd83ae3afef76e455831ae3ce9fe07f0d/Sources/SecureXPC/Server/XPCMachServer.swift#L204-L208
_Originally posted by @jakaplan in https://github.com/trilemma-dev/SecureXPC/pull/23#discussion_r769131546_