corydoras
corydoras

Reputation: 7270

What is the simplest way to setup a server to read data from incoming socket connections?

What is the simplest way (preferably without using third party frameworks) in objective c, to setup a simple server that listens for socket connections, and reads data from the clients on a line by line basis.

ie Ideally you would just need to create an instance of a "server" object, that would pass "client" objects back to which receive incoming data messages.

Upvotes: 3

Views: 640

Answers (3)

corydoras
corydoras

Reputation: 7270

This question has been open for a long time. There appears to be no standard way to do this. I ended up just writing my own Objective C code to wrap C

There are some other "libraries" out there, but I find a couple of .m and .h files much easier to work with than tracking some third party library thats big and complicated and possibly has undiscovered bugs in features I don't want to use anyway.

Upvotes: 0

epatel
epatel

Reputation: 46051

Have a look here How to Write a Cocoa Web Server

Maybe not the simplest solution but it gives a good insight of needed logic for a server

Upvotes: 3

feroze
feroze

Reputation: 7594

Well, there are classes out there, with which, in a couple of lines of code, you could write a simple socket server.

For eg, search for TcpListener() on Google and see if that works for you. I am sure there are examples for Java as well.

Upvotes: 1

Related Questions