Directly creating NSNetService
Directly creating NSNetService
- Subject: Directly creating NSNetService
- From: Rick Mann <email@hidden>
- Date: Sun, 09 Sep 2012 20:42:34 -0700
I want to connect to a TCP or UDP server socket without going through bonjour browsing in iOS, for a voip app. The docs say, "If your application is the client of a network service, you can either create anNSNetService object directly (if you know the exact host and port information)…"
I do know the host and port information. But it's not clear how to create an NSNetService to use this. It still wants a domain and type, and I don't see how to specify a port without using the init method that's supposedly for publishing a service.
In the end, I want to get the NSInput/OutputStream to talk to that port through.
What do I need to do? I'm using netcat to create the listener on the local host port 12345. I just want to connect to that, send a few bytes, and be able to NSLog() and bytes that come back from it, as a test.
Thanks,
--
Rick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden