Skip to content

Instantly share code, notes, and snippets.

@trentbrooks
Created October 3, 2012 06:02
Show Gist options
  • Save trentbrooks/3825313 to your computer and use it in GitHub Desktop.
Save trentbrooks/3825313 to your computer and use it in GitHub Desktop.
Basic native bonjour server service to make a device discoverable in openframeworks ios
#include "testApp.h"
NSNetService *netService;
//--------------------------------------------------------------
void testApp::setup(){
// initialise bonjour server: broadcasts the type + name so you can see devices ip + port
// note: this is a basic example, and does not implement any of the Net Service Delegate Methods to see if the service was published successfully or not
netService = [[NSNetService alloc]
initWithDomain:@""
type:@"_MyService._tcp."
name:@""
port:9876];
[netService publish];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment