views:

180

answers:

1

Hey guys,

I am working on an application for OS X that needs communication of small bits of data between a server side application and a client side application. I tried using a Ruby on Rails server as a backend way of communicating data, which was very simple and easy to implement but caused a bit of issues (I am not a proficient Ruby developer). I want to try to use sockets (NSSocketPort or CFSockets) but am not sure if those are the best ways to tackle the issue. The information I need to transmit is stuff like the client's machine's name, client's network's bandwidth, and other small bits on info (text). Also, another thing to note is that all of the communication will be on the same (hopefully closed) network. If someone can make a helpful and simple recommendation with links for more information, I would appreciate it tremendously! Thanks!

EX. If I had a bunch of clients and wanted to display a list of them, what would be the best approach? There is an application running somewhere on the network, which is to display a list of the clients, and all of the clients have the IP address to the machine with that application running. I want to be able to display a new client on the screen every time a client sends a message to that application. I assumed that using HTTP requests would cause me to have to poll using GETs and display a list every time something new is added. I'd like to be able to call a method instead every time a message is received by something running in the background.

+1  A: 

Is there some reason to not use simple HTTP?

Use HTTP POST to send information from the client to server and GET to retrieve information from the server. If it's little bits of text information, HTTP with JSON encoding should be sufficient for all your needs. If you need security, you get that with HTTPS.

psychotik
Well, what if the user is not expected to have a server to send that information to? Also, some of the information might be boolean flags, which would cause the server side application to have to poll GETs causing issues that occurred with the Ruby approach I took.
hassaanm
If I had a bunch of clients and wanted to display a list of them, what would be the best approach? There is an application running somewhere on the network, which is to display a list of the clients, and all of the clients have the IP address to the machine with that application running. I want to be able to display a new client on the screen every time a client sends a message to that application. I assumed that using HTTP requests would cause me to have to poll and display a list every time something new is added. I'd like to be able to call a method instead every time a message is received.
hassaanm
Sounds like what you want is HTTP + push notifications.
jer
Oh I see. I'm going do a bit of googling on this, but Jar if you could provide a tutorial/example, I would appreciate it greatly!
hassaanm