views:

23

answers:

1

Hey guys,

I am building an application in Cocoa that uses a local Ruby on Rails web server to communicate data and info between the client and server. There are times in the program where I need to poll the web server for some information using HTTP GET requests, but I'm not sure if that is the best approach. Are there any alternatives to polling information between the application and the Ruby on Rails web server?

Thanks!

P.S. If more information is needed, please ask.

+1  A: 

Polling, in of itself, might not be a bad way to go provided the frequency is not too high and you can live with not knowing whatever it is you poll for until you poll for it. It's simple to implement and test generally.

You might also consider Web Sockets with a framework like cramp but that would depend on how much control you have over the server side stack and how willing you'd be to implement the necessary protocol pieces inside your Cocoa client-side.

bjg
The only reason I'm worried about the polling is because, after awhile, the server just hangs and never responds. I was looking into sockets, but needed some direction or help.
hassaanm