Calling xpc_connection_send_message_with_reply_sync in an xpc event handler

StackOverflow https://stackoverflow.com/questions/18685026

  •  28-06-2022
  •  | 
  •  

Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top