[launchd-dev] The MachService key
Damien Sorresso
dsorresso at apple.com
Wed Nov 23 10:28:13 PST 2011
On Nov 22, 2011, at 10:07 PM, Jerry Krinock wrote:
> // Set an Event Handler
> xpc_connection_set_event_handler(listener, ^(xpc_object_t object) {
> char* desc = xpc_copy_description(object);
> NSLog(@"MachServiceDemo Server got connection: %s", desc) ;
> xpc_connection_set_event_handler(listener, ^(xpc_object_t object) {
> char* desc = xpc_copy_description(object);
> NSLog(@"MachServiceDemo Server got message: %s", desc) ;
> free(desc) ;
> }) ;
> }) ;
> xpc_connection_resume(listener) ;
That inner xpc_connection_set_event_handler(3) should target 'object' (the new incoming connection), not 'listener'.
--
Damien Sorresso
dsorresso at apple.com
More information about the launchd-dev
mailing list