On Aug 22, 2011, at 10:45 PM, Rainer Standke wrote:

> I have a command line tool that uses foundation. When I run that tool from 
> the command line it does what I need it to do. This includes sending an 
> NSNotification to a Cocoa application via the NSDistributedNotificationCenter.
> 
> When I call the same command line tool from a php page served by Apache on 
> the same machine, the notification is never sent.

Apache isn’t running in the same login context as your app. In fact it’s an 
entirely separate user account. Distributed notifications don’t go between 
login sessions.

I can’t think of any straightforward solution. Probably the best approach is to 
have your Cocoa app listen on an IP port and then the tool can send a message 
to that port. You’d have to either hardcode the port number or find a way to 
communicate the number to the tool, and the app would need to make sure it 
binds only to the loopback interface to avoid the possibility of getting pinged 
by another machine.

—Jens_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to