• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Directly creating NSNetService
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Directly creating NSNetService
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: sleep in the NKE unload function
  • Next by Date: Re: Directly creating NSNetService
  • Previous by thread: Re: sleep in the NKE unload function
  • Next by thread: Re: Directly creating NSNetService
  • Index(es):
    • Date
    • Thread