• 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: Address from NSSocketPort
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Address from NSSocketPort


  • Subject: Re: Address from NSSocketPort
  • From: j o a r <email@hidden>
  • Date: Wed, 19 Jun 2002 19:24:35 +0200

Right on!

Thanks to Sherm Pendley and Douglas Davidson for providing me with the correct answer!

j o a r

On Wednesday, Jun 19, 2002, at 01:27 Europe/Stockholm, Sherm Pendley wrote:

struct sockaddr_in addrIn = *(struct sockaddr_in *)addrData;
I think your problem is this line. You can't simply typecast an NSData pointer to get at the data the object contains. Instead, you call NSData's "bytes" method, which returns a pointer to the data, like this:
struct sockaddr_in addrIn = *(struct sockaddr_in *)[addrData bytes];
_______________________________________________
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: 
 >Re: Address from NSSocketPort (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Protecting Software w/ Software License -- a modest
  • Next by Date: textViewDidChangeSelection
  • Previous by thread: Re: Address from NSSocketPort
  • Next by thread: Re: Address from NSSocketPort
  • Index(es):
    • Date
    • Thread