I am using CocoaHTTPServer in a MacOSX app (Server) that serves up a local directory of images. I have a corresponding iOS app (Client) that uses AFHTTPRequestOperation (AFNetworking) to retrieve an image file from the Mac over the local network. This is working well.
What I would like to do next is, when a user chooses a specific image in the Mac app the iPad app is notified to download that image and display it.
The method I currently employ is to serve a simple imageToDisplay.txt file that includes the file name of the image to display. The iPad app is constantly polling this file, and if the filename changes it downloads it, etc. It works but seems clunky. I have thought of implementing a GET method on the server that would also return the filename. This approach would still require polling by the client.
Is there a more elegant way to trigger the download (without polling) with the pieces I already have in place? Essentially sending a message from the server to the client - "download image27.jpg now"