In an XPC service I'm developing, I would like to call xpc_connection_send_message_with_reply_sync
or xpc_connection_send_message_with_reply
from within the service's event handler (it requests some additional data from the client).
Instead of sending a message back to the client, it hangs. It seems like the message is waiting to be sent only after my event handler finishes.
Is there a way to communicate with the client without first retuning from the event handler?
Apparently it only hangs when sending a message to the same connection whose event handler my code is running in. When sending a message to a different connection it works fine.