Objective-C Bonjour/TCP Stack

bonjour, cocoa-touch, iphone, objective-c, tcp

Solution

I'd say "do it yourself".

If you don't think that the requirements that you listed in the question will change, then a simple but well-tested implementation of a socket server+netservices and a wrapper for socket+streams will do just fine - you might not even need a "framework" per se.

I've implemented something similar for a tutorial and have been using it in a couple of different projects so far. You are looking at about 200 lines of code for a TCP socket server, and about 300 lines for a Connection class (with delegates and all that).

Problem

I was wondering if anyone knows of a combined Objective-C Bonjour/TCP stack out there, that would allow me to forget about managing sockets, broadcasting services etc and instead let me just host a service and/or get a list of existing services and connect to one. Then just continue by sending messages either to specific clients from the server side or to the server from a client. I presume any received messages and/or discovered services would be sent to me via delegate methods and doing the rest of the dirty work would be up to the stack. I realize this is not all that tough to implement myself and I already have some of it done, but it would make a lot more sense to use a mature framework. Extra points if it's iPhone compatible.

Original source