Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective-c TCP/IP client

I have a TCP server running on a machine. (implemented in Java). I need to connect to that server from a iPhone and send data to the server and also, receive data on the iphone when server pushes me data. So I need to be notified when data pushes from the server.

Is there a way to do this in Objective C(socket programming). Although I googled I couldn't find a solution. But I saw CFSocket etc. Please anyone have a solution?

like image 570
Charith Nidarsha Avatar asked Jun 11 '10 09:06

Charith Nidarsha


2 Answers

after a possible solutions in the internet, I found a nice asynchronous TCP and UDP socket Library here. (http://code.google.com/p/cocoaasyncsocket). This library worked really well for me so far. This wraps the CFSocket and CFStream.

Thanks for your replies.

like image 139
Charith Nidarsha Avatar answered Nov 14 '22 23:11

Charith Nidarsha


You can use the CFNetwork family of classes to implement lower level sockets. Apple has an introduction document that describes the use of these classes.

like image 33
Claus Broch Avatar answered Nov 14 '22 23:11

Claus Broch