title: Using CocoaHTTPServer to "send" a message
body: <p>I am using <strong>CocoaHTTPServer</strong> in a MacOSX app (Server) that serves up a local directory of images. I have a corresponding iOS app (Client) that uses <strong>AFHTTPRequestOperation</strong> (AFNetworking) to retrieve an image file from the Mac over the local network. This is working well.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Is there a more elegant way to trigger the download (without polling) with the pieces I already have in place? <strong>Essentially sending a message from the server to the client</strong> - "download image27.jpg now"</p>