• 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
Re: NSNetService, IP address and port number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSNetService, IP address and port number


  • Subject: Re: NSNetService, IP address and port number
  • From: Chris Hanson <email@hidden>
  • Date: Thu, 16 Jan 2003 16:49:54 -0600

At 10:16 PM +0100 1/16/03, kubernan wrote:
I think i have to use something like [aNetService adresses] and read the returned array,
but i don't know how to use the NSData item of the array with the sockaddr structure
for reading the ip address and port number.

Try looking inside the NSData. Assuming "addressData" is an NSData containing an address:

struct sockaddr_in *addr = (struct sockaddr_in *)[addressData bytes];

This should do it.

Have you looked at the PictureSharing and PictureSharingBrowser examples under /Developer/Examples/Foundation?

-- Chris

--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSNetService, IP address and port number (From: kubernan <email@hidden>)

  • Prev by Date: Re: NSNetService, IP address and port number
  • Next by Date: comboBox crash
  • Previous by thread: Re: NSNetService, IP address and port number
  • Next by thread: Safari bookmark bar
  • Index(es):
    • Date
    • Thread