Network Programming on iPhone
Hi there!
I'm trying to implement an iPhone Client which is communicating with a Java Server via TCP and/or UDP.
It seems that there are a couple of options how to do that and i'm a little bit confused right now. I'm also new to this Objective-C stuff but trying to get used to it.
I read that UNIX Sockets are available. I have to write C-Code for that right? Can i just write the C-Code into my ObjC implementation or how should i do that? Isn't that ugly? Or can i somehow write a C coded file and implement the stuff into an ObjC class?
Additionally i found out that i may use CFNetwork. But i can't find a good resource which tells me how to do that. Do i have to create a CFSocket first and then create the read/write streams for that?
After that i saw NSStreams should be also an option.
I'm a bit confused and don't know which technology to choose and how to implement the whole thing. I "just" need to add network functionality to an existing iPhone Application to transmit data. The best thing would be a class that i can instanciate (giving it a host, port, calling a connect function ...) and use it to send data.
What would you recommend? Do you have any hints or examples for me? That would be very great.
Thanks in advance,
kiwaque
|