Vishnu
Vishnu

Reputation: 208

Listening to a tcp port in iphone

I need to listen to a TCP port and collect the binary data from the port in my iphone how this could be done . I had searched a lot for the same but did not find anything worth, please help me any links, or sample code be greatly appretiated

Upvotes: 1

Views: 3195

Answers (2)

Sean Lintern
Sean Lintern

Reputation: 3141

There is a very useful socket library called GCDAsyncSocket on github that can be used to make both TCP/UDP sockets and comes with delegate methods for reading and writing data

GCDAsyncSocket

Upvotes: 2

Antonio MG
Antonio MG

Reputation: 20410

The only thing you need to do is open a socket, you have two options:

Create the socket in pure C: Sockets in C

Or use the classes that Apple provides to work with sockets:

Introduction to Stream Programming Guide for Cocoa

If you are going to do something simple, the first option is the easiest

Upvotes: 2

Related Questions