开发者

objective-c : iphone programming wirelessly lock computer from iphone

i am doing an application in which i need to lock,tu开发者_StackOverflowrn off the computer wirelessly. It is possible?


Yes, but you'll have to write two programs:

  • The iPhone app that sends the lock command to the computer (over the network)

  • A program running on the computer that listens on the network for commands and locks the computer when it gets them


It's possible. For example, you could run a daemon on your computer that listens for a command to lock or shutdown, and your iPhone app can connect to the computer and issue the appropriate command. Of course, you have some considerations such as firewalls, NAT, and security issues to deal with.


To bypass some of the problems Jeff mentioned, you need to build a service that brokers communication between the iPhone app and the machine.

The program running on the machine needs to talk to this service over HTTP/S (so no NAT/Firewall problems), and keep polling (see long-polling). The iPhone app sends the server information when it wants to shut down the computer. The server sends an appropriate response in such a case to the long-poll, at which time the client software on the computer turns it off.

So yes, to do this right you need a stateful server.

Good luck.


Airlock does something similar for the iPhone/Mac via a System Preferences plugin and bluetooth (but no app on the actual phone).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜