Possible Duplicate:
Transfer files between 2 iPhones over wifi?
I already have my device connected to another device over wifi, now what i need to do is to be able to send data between them. I followed a tutorial here:
http://www.macresearch.org/cocoa-scientists-part-xxix-message
Which got complicated and errorsome as soon as i imported the open source ‘AsyncSocket’.
There must be a simple way to do it, just to use the network which I already have set up from a server to a client, to send a message across?
I’m using NSNetService and NSNetServiceBrowser. I hope somebody can help?
I’d recommend using HTTP as a message protocol.
You get the benefit of being able to simulate messages using a web browser or a client tool, and HTTP Scoop is an excellent debugging tool.
The client-side code is all ready in NSURLConnection, and there are a few open source HTTP servers that are ready to integrate into your app. I’d recommend Matt Gallagher’s implementation, I’ve used it very successfully to do exactly what you’re describing.