Calling xpc_connection_send_message_with_reply_sync in an xpc event handler

1k views Asked by At

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?

1

There are 1 answers

0
yairchu On BEST ANSWER

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.